3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(&$var) { $var = 2; } $a = 1; foo($a); var_dump($a); class A { public function do() { foo($this); var_dump($this); } public function doo() { $a = new self(); foo($a); var_dump($a); } } $a = new A(); $a->do(); $a->doo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2PkHO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                       !0, 1
    9     1        INIT_FCALL                                                   'foo'
          2        SEND_REF                                                     !0
          3        DO_FCALL                                          0          
   10     4        INIT_FCALL                                                   'var_dump'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                                     
   31     7        NEW                                                  $4      'A'
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !0, $4
   32    10        INIT_METHOD_CALL                                             !0, 'do'
         11        DO_FCALL                                          0          
   33    12        INIT_METHOD_CALL                                             !0, 'doo'
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2PkHO
function name:  foo
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        ASSIGN                                                       !0, 2
    6     2      > RETURN                                                       null

End of function foo

Class A:
Function do:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2PkHO
function name:  do
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                                   'foo'
          1        FETCH_THIS                                           $0      
          2        SEND_REF                                                     $0
          3        DO_FCALL                                          0          
   19     4        INIT_FCALL                                                   'var_dump'
          5        FETCH_THIS                                           ~2      
          6        SEND_VAL                                                     ~2
          7        DO_ICALL                                                     
   20     8      > RETURN                                                       null

End of function do

Function doo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2PkHO
function name:  doo
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   NEW                              self                $1      
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   25     3        INIT_FCALL                                                   'foo'
          4        SEND_REF                                                     !0
          5        DO_FCALL                                          0          
   26     6        INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                                     
   27     9      > RETURN                                                       null

End of function doo

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.13 ms | 1658 KiB | 17 Q