3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function test() { echo 'test'; } } function changeMe(&$obj) { $obj = function(){ $test = function(){echo 'im a test';}; }; } $foo = new Foo(); var_dump($foo); changeMe($foo); $foo->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNiaO
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   20     6        INIT_FCALL                                               'changeme'
          7        SEND_REF                                                 !0
          8        DO_FCALL                                      0          
   22     9        INIT_METHOD_CALL                                         !0, 'test'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function changeme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNiaO
function name:  changeMe
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBNiaO%3A13%240'
          2        ASSIGN                                                   !0, ~1
   16     3      > RETURN                                                   null

End of function changeme

Function %00%7Bclosure%7D%2Fin%2FBNiaO%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNiaO
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBNiaO%3A14%241'
          1        ASSIGN                                                   !0, ~1
   15     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBNiaO%3A13%240

Function %00%7Bclosure%7D%2Fin%2FBNiaO%3A14%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNiaO
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'im+a+test'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBNiaO%3A14%241

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNiaO
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'test'
    8     1      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.02 ms | 1403 KiB | 16 Q