3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callableToString($callable) { $refFunc = new ReflectionFunction($callable); $startLine = $refFunc->getStartLine(); $endLine = $refFunc->getEndLine(); print $statLine; } callableToString(function($var){print "yes no yes";});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMH58
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'callabletostring'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmMH58%3A11%240'
          2        SEND_VAL                                                 ~0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function callabletostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMH58
function name:  callableToString
number of ops:  13
compiled vars:  !0 = $callable, !1 = $refFunc, !2 = $startLine, !3 = $endLine, !4 = $statLine
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $5      'ReflectionFunction'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
    5     5        INIT_METHOD_CALL                                         !1, 'getStartLine'
          6        DO_FCALL                                      0  $8      
          7        ASSIGN                                                   !2, $8
    6     8        INIT_METHOD_CALL                                         !1, 'getEndLine'
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !3, $10
    8    11        ECHO                                                     !4
    9    12      > RETURN                                                   null

End of function callabletostring

Function %00%7Bclosure%7D%2Fin%2FmMH58%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMH58
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        ECHO                                                     'yes+no+yes'
          2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmMH58%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1399 KiB | 14 Q