3v4l.org

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

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dV5jR
function name:  g
number of ops:  10
compiled vars:  !0 = $txt, !1 = $goal, !2 = $_g, !3 = $str
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%2FdV5jR%3A5%240'
          3        BIND_LEXICAL                                             ~5, !1
          4        ASSIGN                                                   !2, ~5
   13     5        INIT_DYNAMIC_CALL                                        !2
          6        SEND_VAR_EX                                              !3
          7        DO_FCALL                                      0  $7      
          8      > RETURN                                                   $7
   14     9*     > RETURN                                                   null

End of function g

Function %00%7Bclosure%7D%2Fin%2FdV5jR%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dV5jR
function name:  {closure}
number of ops:  8
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
    6     2      > JMPZ                                                     !0, ->5
    7     3    >   CONCAT                                           ~3      !1, !0
          4      > RETURN                                                   ~3
    9     5    >   ASSIGN_OP                                     8          !1, 'o'
   10     6      > RETURN                                                   !2
   11     7*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.81 ms | 1399 KiB | 14 Q