3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct( public readonly string $bar ){} } $foo = new Foo('bar'); var_dump($foo->bar); $arrayObject = new ArrayObject($foo); $arrayObject['bar'] = new \DateTimeImmutable("1986-08-20 midnight"); var_dump($foo->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gSWFF
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo, !1 = $arrayObject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Foo'
          1        SEND_VAL_EX                                              'bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   12     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~5      !0, 'bar'
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                                 
   14     8        NEW                                              $7      'ArrayObject'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   15    12        NEW                                              $11     'DateTimeImmutable'
         13        SEND_VAL_EX                                              '1986-08-20+midnight'
         14        DO_FCALL                                      0          
         15        ASSIGN_DIM                                               !1, 'bar'
         16        OP_DATA                                                  $11
   17    17        INIT_FCALL                                               'var_dump'
         18        FETCH_OBJ_R                                      ~13     !0, 'bar'
         19        SEND_VAL                                                 ~13
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gSWFF
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.09 ms | 997 KiB | 14 Q