Skip to content

Regression: DateTime(Immutable)::createFromTimestamp() on PROFILE=8.3 — Zend/php-src 8.4+ only (re-#18027, ext/date/php_date.c) #22795

Closed

Description

@PurHur

Category

Regression: · php-src-strict · profile gate (re-#5973 / re-#18027)

Problem

DateTime::createFromTimestamp() / DateTimeImmutable::createFromTimestamp() are PHP 8.4+ (php.net 8.4 release). supportsDateTimeCreateFromTimestamp() enables them from PROFILE=8.3 (comment incorrectly says "PHP 8.3+"). Zend 8.3 has no such methods. (getMicrosecond/setMicrosecond are already correctly 8.4-gated.)

Repro Zend 8.3 VM PROFILE=8.3 (2026-07-24)
method_exists(DateTimeImmutable::class, 'createFromTimestamp') false true
DateTimeImmutable::createFromTimestamp(0)->format('U') Error 0

master@0ae5abab2.

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/cfts83.php <<\"PHP\"
<?php
echo \"immutable=\", method_exists(DateTimeImmutable::class, \"createFromTimestamp\") ? \"1\" : \"0\", PHP_EOL;
echo \"mutable=\", method_exists(DateTime::class, \"createFromTimestamp\") ? \"1\" : \"0\", PHP_EOL;
echo \"getMicrosecond=\", method_exists(DateTimeImmutable::class, \"getMicrosecond\") ? \"1\" : \"0\", PHP_EOL;
PHP
PHP_COMPILER_PROFILE=8.3 php bin/vm.php /tmp/cfts83.php
PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/cfts83.php'

Done when

  • PROFILE=8.3: both createFromTimestamp methods absent; getMicrosecond still absent
  • PROFILE=8.4: createFromTimestamp present and matches Zend
  • Compliance guard; php-src-strict

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 24, 2026
  2. PurHur commented on Jul 24, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #22789, #22795, #22254)

    Queued after #22789: gate createFromTimestamp to PROFILE=8.4+ (match supportsDateTimeMicrosecond).

  3. PurHur commented on Jul 24, 2026

    @PurHur
    OwnerAuthor

    merged: #22805

    Verification:

    • PROFILE=8.3: createFromTimestamp absent (immutable=0/mutable=0); getMicrosecond still absent
    • PROFILE=8.4: methods present; createFromTimestamp(0)->format('U') === 0
    • compliance create_from_timestamp_* phpts OK (3); DateTimeCreateFromTimestampVMTest under PROFILE=8.4 OK

    Next in batch: #22254 (xmlrpc encode_request/decode_request/is_fault/get_type/set_type).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions