3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { function test($function) { echo 1; $function(); throw new Exception('test'); } } $app = new App(); $app->test(function() use ($app){ echo 2; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQkbM
function name:  (null)
number of ops:  9
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'App'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdQkbM%3A12%240'
          5        BIND_LEXICAL                                             ~4, !0
   14     6        SEND_VAL_EX                                              ~4
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FdQkbM%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQkbM
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   BIND_STATIC                                              !0
   13     1        ECHO                                                     2
   14     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdQkbM%3A12%240

Class App:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/dQkbM
function name:  test
number of ops:  9
compiled vars:  !0 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ECHO                                                     1
    6     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
    7     4        NEW                                              $2      'Exception'
          5        SEND_VAL_EX                                              'test'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $2
    8     8*     > RETURN                                                   null

End of function test

End of class App.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.3 ms | 1394 KiB | 13 Q