3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function test() { exit(0); } } $closure = function(Foo $foo) { $foo->test(); }; $closure->__invoke(); echo 'test';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YGFva
function name:  (null)
number of ops:  6
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYGFva%3A11%240'
          1        ASSIGN                                                   !0, ~1
   15     2        INIT_METHOD_CALL                                         !0, '__invoke'
          3        DO_FCALL                                      0          
   16     4        ECHO                                                     'test'
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FYGFva%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YGFva
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_METHOD_CALL                                         !0, 'test'
          2        DO_FCALL                                      0          
   13     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYGFva%3A11%240

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

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.57 ms | 1394 KiB | 13 Q