3v4l.org

run code in 300+ PHP versions simultaneously
<?php function g($txt = '') { $goal = 'g'; $_g = function($str = '') use ($goal, $_g) { if ($str) { return $goal . $str; } $goal .= 'o'; return $_g; }; return $_g($txt); } echo g()('al');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfoBS
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'g'
          1        DO_FCALL                                      0  $0      
          2        INIT_DYNAMIC_CALL                                        $0
          3        SEND_VAL_EX                                              'al'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfoBS
function name:  g
number of ops:  11
compiled vars:  !0 = $txt, !1 = $goal, !2 = $_g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      ''
    3     1        ASSIGN                                                   !1, 'g'
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpfoBS%3A5%240'
          3        BIND_LEXICAL                                             ~4, !1
          4        BIND_LEXICAL                                             ~4, !2
          5        ASSIGN                                                   !2, ~4
   13     6        INIT_DYNAMIC_CALL                                        !2
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $6      
          9      > RETURN                                                   $6
   14    10*     > RETURN                                                   null

End of function g

Function %00%7Bclosure%7D%2Fin%2FpfoBS%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfoBS
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $str, !1 = $goal, !2 = $_g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    6     3      > JMPZ                                                     !0, ->6
    7     4    >   CONCAT                                           ~3      !1, !0
          5      > RETURN                                                   ~3
    9     6    >   ASSIGN_OP                                     8          !1, 'o'
   10     7      > RETURN                                                   !2
   11     8*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.96 ms | 1390 KiB | 14 Q