3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function bar(callable $callable) { $callable(); } function printStr() { echo "hi"; } } $foo = new foo(); $foo->bar(fn() => $foo->printStr());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/veMsZ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !0
          6        SEND_VAL_EX                                              ~4
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/veMsZ
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   BIND_STATIC                                              !0
          1        INIT_METHOD_CALL                                         !0, 'printStr'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
          4*     > RETURN                                                   null

End of Dynamic Function 0

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

End of function bar

Function printstr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/veMsZ
function name:  printStr
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'hi'
   10     1      > RETURN                                                   null

End of function printstr

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.9 ms | 1008 KiB | 13 Q