3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AClass { public function getFnc() { $f = function() { echo "hello from a function"; }; return $f; } } $r = ($c->getFnc()());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fLo1E
function name:  (null)
number of ops:  6
compiled vars:  !0 = $r, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_METHOD_CALL                                         !1, 'getFnc'
          1        DO_FCALL                                      0  $2      
          2        INIT_DYNAMIC_CALL                                        $2
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FfLo1E%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fLo1E
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'hello+from+a+function'
    7     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfLo1E%3A5%240

Class AClass:
Function getfnc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fLo1E
function name:  getFnc
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FfLo1E%3A5%240'
          1        ASSIGN                                                   !0, ~1
    8     2      > RETURN                                                   !0
    9     3*     > RETURN                                                   null

End of function getfnc

End of class AClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.2 ms | 1393 KiB | 13 Q