3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $baz = array('bazz' => null); public function bar() { $key = 'baz'; $this->$key['bazz'] = 123; var_dump($this->$key); } } $a = (new Foo()); var_dump([$a => '123']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BXPQa
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        INIT_ARRAY                                       ~4      '123', !0
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BXPQa
function name:  bar
number of ops:  9
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'baz'
   10     1        FETCH_OBJ_W                                      $2      !0
          2        ASSIGN_DIM                                               $2, 'bazz'
          3        OP_DATA                                                  123
   12     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~4      !0
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   13     8      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.24 ms | 1399 KiB | 15 Q