3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public $bar = 1; function __construct($a) { $this->bar = $a; } } function foo1(&$test) { $test = new X(12); } function foo2($test){ $test = new X(12); } $n = new X(0); foo2($n); var_dump($n); foo1($n); var_dump($n);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hcpd0
function name:  (null)
number of ops:  17
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'X'
          1        SEND_VAL_EX                                              0
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        INIT_FCALL                                               'foo2'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   17     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'foo1'
         11        SEND_REF                                                 !0
         12        DO_FCALL                                      0          
   19    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function foo1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hcpd0
function name:  foo1
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        NEW                                              $1      'X'
          2        SEND_VAL_EX                                              12
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
    9     5      > RETURN                                                   null

End of function foo1

Function foo2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hcpd0
function name:  foo2
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        NEW                                              $1      'X'
          2        SEND_VAL_EX                                              12
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   13     5      > RETURN                                                   null

End of function foo2

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

End of function __construct

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.6 ms | 1005 KiB | 16 Q