3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set("xdebug.max_nesting_level", 10000000); function foo($n) { if($n == 0) return 'ok'; return foo($n-1); } $time = microtime(true); foo(20000); echo (microtime(true) - $time) . ' elapsed';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H2PGK
function name:  (null)
number of ops:  18
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'xdebug.max_nesting_level'
          2        SEND_VAL                                                 10000000
          3        DO_ICALL                                                 
    9     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        ASSIGN                                                   !0, $2
   10     8        INIT_FCALL                                               'foo'
          9        SEND_VAL                                                 20000
         10        DO_FCALL                                      0          
   11    11        INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $5      
         14        SUB                                              ~6      $5, !0
         15        CONCAT                                           ~7      ~6, '+elapsed'
         16        ECHO                                                     ~7
         17      > 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/H2PGK
function name:  foo
number of ops:  10
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, 0
          2      > JMPZ                                                     ~1, ->4
          3    > > RETURN                                                   'ok'
    6     4    >   INIT_FCALL_BY_NAME                                       'foo'
          5        SUB                                              ~2      !0, 1
          6        SEND_VAL_EX                                              ~2
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
    7     9*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.51 ms | 1399 KiB | 18 Q