3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; function foobar($a) { if ($a < 51) { echo "$a\n"; foobar($a + 1); } } print foobar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F67V7
function name:  (null)
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
   10     1        INIT_FCALL                                               'foobar'
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
          4      > RETURN                                                   1

Function foobar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/F67V7
function name:  foobar
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_SMALLER                                               !0, 51
          2      > JMPZ                                                     ~1, ->10
    6     3    >   NOP                                                      
          4        FAST_CONCAT                                      ~2      !0, '%0A'
          5        ECHO                                                     ~2
    7     6        INIT_FCALL_BY_NAME                                       'foobar'
          7        ADD                                              ~3      !0, 1
          8        SEND_VAL_EX                                              ~3
          9        DO_FCALL                                      0          
    9    10    > > RETURN                                                   null

End of function foobar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.28 ms | 1392 KiB | 15 Q