Skip to content

NullArgument emitted for new DateTime(null, new DateTimeZone('America/Los_Angeles')) #2590

@TysonAndre

Description

@TysonAndre

It's possible to suppress or work around this by writing 'now' or suppressing it, but it is working code with examples in official documentation https://www.php.net/manual/en/datetime.construct.php

// Current date/time in the specified time zone.
$date = new DateTime(null, new DateTimeZone('Pacific/Nauru'));
echo $date->format('Y-m-d H:i:sP') . "\n";

Related to phan/PHPSignatures#6 (comment) - low priority to me

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions