Skip to content

tm2unixtime.c:458:4 integer overflow #16864

Closed
@chongwick

Description

@chongwick

Description

The following code:

<?php
$v1 = PHP_INT_MIN;
$v4 = new DateTime();
$v4->setDate($v1, 1, 1);

Resulted in this output:

/home/dan/php-src/ext/date/lib/tm2unixtime.c:458:4: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long long int'

But I expected this output instead:

PHP Version

PHP 8.4-dev

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions