Skip to content

member access within null pointer parse_tz.c:800 #16163

@chongwick

Description

@chongwick

Description

The following code:

<?php
class MyDateTimeZone extends DateTimeZone {
    public function __construct($offset = 0) {
        $this->offset = $offset;
    }
}

$mdtz = new MyDateTimeZone(PHP_INT_MAX);
$fusion = $mdtz;
$d[] = date_create("2005-07-14 22:30:41", $fusion);
foreach($d as $date) {
    echo $date->format(DateTime::ISO8601), "\n";
}
?>

Resulted in this output:

/home/dan/php-8.3.9/ext/date/lib/parse_tz.c:800:16: runtime error: member access within null pointer of type 'struct timelib_tzinfo'

But I expected this output instead:

PHP Version

8.3.9

Operating System

No response

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