3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $name = null; public function __construct($name) { $this->name = $name; } } $a = array('foo' => 'Foo'); $b = new $a['foo']('hello'); var_dump($b->name);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HE5IR
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   10     1        FETCH_DIM_R                                      ~3      !0, 'foo'
          2        FETCH_CLASS                                   0  $4      ~3
          3        NEW                                              $5      $4
          4        SEND_VAL_EX                                              'hello'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   11     7        INIT_FCALL                                               'var_dump'
          8        FETCH_OBJ_R                                      ~8      !1, 'name'
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.69 ms | 1395 KiB | 15 Q