3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FedDUS%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/edDUS
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%2FedDUS%3A11%240

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/edDUS
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:
173.77 ms | 1399 KiB | 17 Q