3v4l.org

run code in 300+ PHP versions simultaneously
<?php function g($x=0){return$x?'g'.$x:function($y=0){return $y?g($y):'o';};} $x=g(); echo $x('al'); /* 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/uIBGv
function name:  (null)
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'g'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    4     3        INIT_DYNAMIC_CALL                                        !0
          4        SEND_VAL_EX                                              'al'
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   11     7      > 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 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uIBGv
function name:  g
number of ops:  9
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                                                      ->7
          5    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuIBGv%3A2%240'
          6        QM_ASSIGN                                        ~2      ~3
          7    > > RETURN                                                   ~2
          8*     > RETURN                                                   null

End of function g

Function %00%7Bclosure%7D%2Fin%2FuIBGv%3A2%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 7
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: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uIBGv
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV_INIT                                        !0      0
          1      > JMPZ                                                     !0, ->7
          2    >   INIT_FCALL_BY_NAME                                       'g'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $1      
          5        QM_ASSIGN                                        ~2      $1
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~2      'o'
          8    > > RETURN                                                   ~2
          9*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.23 ms | 1398 KiB | 14 Q