3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); for ($i = 0; $i < 1000000; $i++) { } return microtime(true) - $s; } function test2() { $s = microtime(true); $i = 0; while ($i < 1000000) { $i++; } return microtime(true) - $s; } echo test1() . "\n\n"; echo test2() . "\n\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rknDM
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'test1'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%0A%0A'
          3        ECHO                                                     ~1
   21     4        INIT_FCALL                                               'test2'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, '%0A%0A'
          7        ECHO                                                     ~3
          8      > RETURN                                                   1

Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/rknDM
function name:  test1
number of ops:  15
compiled vars:  !0 = $s, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->7
          6    >   PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 1000000
          8      > JMPNZ                                                    ~6, ->6
    8     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $7      
         12        SUB                                              ~8      $7, !0
         13      > RETURN                                                   ~8
    9    14*     > RETURN                                                   null

End of function test1

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/rknDM
function name:  test2
number of ops:  15
compiled vars:  !0 = $s, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   13     4        ASSIGN                                                   !1, 0
   14     5      > JMP                                                      ->7
   15     6    >   PRE_INC                                                  !1
   14     7    >   IS_SMALLER                                               !1, 1000000
          8      > JMPNZ                                                    ~6, ->6
   17     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $7      
         12        SUB                                              ~8      $7, !0
         13      > RETURN                                                   ~8
   18    14*     > RETURN                                                   null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.33 ms | 1400 KiB | 19 Q