3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test ($x, $y) { if (($x + $y) > 0) { test($x, $y - 1); return; } return $y; } function test2 ($x) { if ($x < time()) { test2($x + 1); return; } return $x; } echo test2(test(111, 110));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qrsdo
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'test2'
          1        INIT_FCALL                                               'test'
          2        SEND_VAL                                                 111
          3        SEND_VAL                                                 110
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

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

End of function test

Function test2:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qrsdo
function name:  test2
number of ops:  12
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'time'
          2        DO_ICALL                                         $1      
          3        IS_SMALLER                                               !0, $1
          4      > JMPZ                                                     ~2, ->10
   13     5    >   INIT_FCALL_BY_NAME                                       'test2'
          6        ADD                                              ~3      !0, 1
          7        SEND_VAL_EX                                              ~3
          8        DO_FCALL                                      0          
   14     9      > RETURN                                                   null
   16    10    > > RETURN                                                   !0
   17    11*     > RETURN                                                   null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.02 ms | 1403 KiB | 18 Q