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) { var_dump(compact('foo')); } } $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/7mX3h
function name:  (null)
number of ops:  8
compiled vars:  !0 = $f, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   28     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/7mX3h
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/7mX3h
function name:  __construct
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'compact'
          3        SEND_VAL                                                 'foo'
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
   22     7      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159 ms | 1395 KiB | 17 Q