3v4l.org

run code in 500+ PHP versions simultaneously
<?php function yourFunction($text, callable $myFunction) { return $myFunction($text); } $offset = 5; echo yourFunction('Hello World', function($text) use($offset) { return substr($text, $offset); });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CFMrI
function name:  (null)
number of ops:  9
compiled vars:  !0 = $offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, 5
    7     1        INIT_FCALL                                                   'yourfunction'
          2        SEND_VAL                                                     'Hello+World'
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          4        BIND_LEXICAL                                                 ~2, !0
    9     5        SEND_VAL                                                     ~2
    7     6        DO_FCALL                                          0  $3      
    9     7        ECHO                                                         $3
          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/CFMrI
function name:  {closure:/in/CFMrI:7}
number of ops:  5
compiled vars:  !0 = $text, !1 = $offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
    8     2        FRAMELESS_ICALL_2                substr              ~2      !0, !1
          3      > RETURN                                                       ~2
    9     4*     > RETURN                                                       null

End of Dynamic Function 0

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

End of function yourfunction

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
229.4 ms | 3295 KiB | 14 Q