3v4l.org

run code in 300+ PHP versions simultaneously
<?php $php = ""; $i = 0; function f() { global $php; global $i; $i++; if($i > 5) { return $php; } return "\${" . f() . "}"; } var_dump(f());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rTDhn
function name:  (null)
number of ops:  8
compiled vars:  !0 = $php, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    5     1        ASSIGN                                                   !1, 0
   20     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'f'
          4        DO_FCALL                                      0  $4      
          5        SEND_VAR                                                 $4
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rTDhn
function name:  f
number of ops:  12
compiled vars:  !0 = $php, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_GLOBAL                                              !0, 'php'
    9     1        BIND_GLOBAL                                              !1, 'i'
   13     2        PRE_INC                                                  !1
   14     3        IS_SMALLER                                               5, !1
          4      > JMPZ                                                     ~3, ->6
   15     5    > > RETURN                                                   !0
   17     6    >   INIT_FCALL_BY_NAME                                       'f'
          7        DO_FCALL                                      0  $4      
          8        CONCAT                                           ~5      '%24%7B', $4
          9        CONCAT                                           ~6      ~5, '%7D'
         10      > RETURN                                                   ~6
   18    11*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.08 ms | 1398 KiB | 16 Q