3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $name = ""; public $surname = ""; public function __construct() { $this->name = "Name"; $this->surname = "Surname"; } } class Bar { public function __construct(Foo $foo) { $object = compact('foo'); echo $object['foo']['name']; } } $f = new Foo(); $b = new Bar($f);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3ZBIC
function name:  (null)
number of ops:  8
compiled vars:  !0 = $f, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   30     3        NEW                                              $5      'Bar'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
          7      > RETURN                                                   1

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

End of function __construct

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3ZBIC
function name:  __construct
number of ops:  9
compiled vars:  !0 = $foo, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        INIT_FCALL                                               'compact'
          2        SEND_VAL                                                 'foo'
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   23     5        FETCH_DIM_R                                      ~4      !1, 'foo'
          6        FETCH_DIM_R                                      ~5      ~4, 'name'
          7        ECHO                                                     ~5
   24     8      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.14 ms | 1396 KiB | 15 Q