3v4l.org

run code in 300+ PHP versions simultaneously
<?php // tail recursion function foo($n) { if($n == 0) return; return foo($n-1); } $time = microtime(true); foo(1000); echo (microtime(true) - $time) . ' elapsed';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sCY6v
function name:  (null)
number of ops:  14
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
    9     4        INIT_FCALL                                               'foo'
          5        SEND_VAL                                                 1000
          6        DO_FCALL                                      0          
   10     7        INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $4      
         10        SUB                                              ~5      $4, !0
         11        CONCAT                                           ~6      ~5, '+elapsed'
         12        ECHO                                                     ~6
         13      > RETURN                                                   1

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

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1397 KiB | 16 Q