3v4l.org

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

Function g:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qXrCB
function name:  g
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      0
          1      > JMPZ                                                     !0, ->5
          2    >   CONCAT                                           ~1      'g', !0
          3        QM_ASSIGN                                        ~2      ~1
          4      > JMP                                                      ->8
          5    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqXrCB%3A2%240'
          6        BIND_LEXICAL                                             ~3, !0
          7        QM_ASSIGN                                        ~2      ~3
          8    > > RETURN                                                   ~2
          9*     > RETURN                                                   null

End of function g

Function %00%7Bclosure%7D%2Fin%2FqXrCB%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qXrCB
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $y, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL_BY_NAME                                       'g'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      !1, $2
          6      > RETURN                                                   ~3
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqXrCB%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.93 ms | 1399 KiB | 14 Q