3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTimeImmutable extends DateTimeImmutable { public function __construct( string $datetime = "now", ?DateTimeZone $timezone = null, private ?bool $myProperty = null, ) { parent::__construct($datetime, $timezone); } } var_dump($datetime = new MyDateTimeImmutable('2022-12-22T11:26:00Z', myProperty: true)); var_dump($serialized = serialize($datetime)); var_dump(unserialize($serialized));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8q4Or
function name:  (null)
number of ops:  23
compiled vars:  !0 = $datetime, !1 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $2      'MyDateTimeImmutable'
          2        SEND_VAL_EX                                              '2022-12-22T11%3A26%3A00Z'
          3        SEND_VAL_EX                                              <true>, 'myProperty'
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1          
          6        ASSIGN                                           ~4      !0, $2
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'serialize'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        ASSIGN                                           ~7      !1, $6
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
   15    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'unserialize'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class MyDateTimeImmutable:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8q4Or
function name:  __construct
number of ops:  10
compiled vars:  !0 = $datetime, !1 = $timezone, !2 = $myProperty
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      'now'
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
          3        ASSIGN_OBJ                                               'myProperty'
          4        OP_DATA                                                  !2
    9     5        INIT_STATIC_METHOD_CALL                                  
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   10     9      > RETURN                                                   null

End of function __construct

End of class MyDateTimeImmutable.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.31 ms | 1013 KiB | 16 Q