3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { function test($function) { echo 1; } } $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/1na9p
function name:  (null)
number of ops:  9
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'App'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1na9p%3A10%240'
          5        BIND_LEXICAL                                             ~4, !0
   12     6        SEND_VAL_EX                                              ~4
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F1na9p%3A10%240

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

End of function test

End of class App.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.45 ms | 1393 KiB | 13 Q