3v4l.org

run code in 300+ PHP versions simultaneously
<?php $php = ""; $i = 0; function f() { global $i; $i++; if($i > 5) { return 'i'; } return "\${" . f() . "}"; } var_dump(f());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p2UZa
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
   16     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 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p2UZa
function name:  f
number of ops:  11
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_GLOBAL                                              !0, 'i'
    9     1        PRE_INC                                                  !0
   10     2        IS_SMALLER                                               5, !0
          3      > JMPZ                                                     ~2, ->5
   11     4    > > RETURN                                                   'i'
   13     5    >   INIT_FCALL_BY_NAME                                       'f'
          6        DO_FCALL                                      0  $3      
          7        CONCAT                                           ~4      '%24%7B', $3
          8        CONCAT                                           ~5      ~4, '%7D'
          9      > RETURN                                                   ~5
   14    10*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.34 ms | 1397 KiB | 16 Q