3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inc = 2; $s=0; recv(5); function recv($v) { global $inc,$s; if ($v >= 1) { echo $inc * $v . " "; $v--; $s = $s + $inc * $v; recv($v); } } echo "The sum is $s"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bkClq
function name:  (null)
number of ops:  9
compiled vars:  !0 = $inc, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 2
    3     1        ASSIGN                                                   !1, 0
    4     2        INIT_FCALL_BY_NAME                                       'recv'
          3        SEND_VAL_EX                                              5
          4        DO_FCALL                                      0          
   24     5        NOP                                                      
          6        FAST_CONCAT                                      ~5      'The+sum+is+', !1
          7        ECHO                                                     ~5
   25     8      > RETURN                                                   1

Function recv:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/bkClq
function name:  recv
number of ops:  16
compiled vars:  !0 = $v, !1 = $inc, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        BIND_GLOBAL                                              !1, 'inc'
          2        BIND_GLOBAL                                              !2, 's'
    9     3        IS_SMALLER_OR_EQUAL                                      1, !0
          4      > JMPZ                                                     ~3, ->15
   10     5    >   MUL                                              ~4      !1, !0
          6        CONCAT                                           ~5      ~4, '+'
          7        ECHO                                                     ~5
   12     8        PRE_DEC                                                  !0
   13     9        MUL                                              ~7      !1, !0
         10        ADD                                              ~8      !2, ~7
         11        ASSIGN                                                   !2, ~8
   15    12        INIT_FCALL_BY_NAME                                       'recv'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
   21    15    > > RETURN                                                   null

End of function recv

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.63 ms | 941 KiB | 14 Q