Skip to content

integer overflow in tm2unixtime.c:464:41 #17414

@chongwick

Description

@chongwick

Description

The following code:

<?php
$min_int = PHP_INT_MIN;
$datetime = mktime(0, 0, 0, 1, $min_int, 1970);

Resulted in this output:

/home/dan/php-src/ext/date/lib/tm2unixtime.c:464:41: runtime error: signed integer overflow: -9223372036854056341 - 719468 cannot be represented in type 'long long int'

But I expected this output instead:

PHP Version

8.4.2

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions