3v4l.org

run code in 300+ PHP versions simultaneously
<?php $clsr = function () { var_dump($this); }; $clsr(); class MyClass { public function foo($fun) { $fun(); } } $a = new MyClass; $a->foo($clsr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iFE51
function name:  (null)
number of ops:  11
compiled vars:  !0 = $clsr, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FiFE51%3A3%240'
          1        ASSIGN                                                   !0, ~2
    5     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   13     4        NEW                                              $5      'MyClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   14     7        INIT_METHOD_CALL                                         !1, 'foo'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FiFE51%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iFE51
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FiFE51%3A3%240

Class MyClass:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iFE51
function name:  foo
number of ops:  4
compiled vars:  !0 = $fun
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   10     3      > RETURN                                                   null

End of function foo

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.89 ms | 1387 KiB | 15 Q