3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array(); $i = 0; $start = microtime(true); for($i = 0; $i < 100000; $i++) { if(count($test)) { throw new Exception(); } } $middle = microtime(true); for($i = 0; $i < 100000; $i++) { if (!empty($test)) { throw new Exception(); } } $end = microtime(true); echo ($middle - $start) . chr(10); echo ($end - $middle) . chr(10); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 8
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 22
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 22
Branch analysis from position: 31
Branch analysis from position: 22
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 8
Branch analysis from position: 16
Branch analysis from position: 8
filename:       /in/3ShnG
function name:  (null)
number of ops:  42
compiled vars:  !0 = $test, !1 = $i, !2 = $start, !3 = $middle, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
    6     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
    7     6        ASSIGN                                                   !1, 0
          7      > JMP                                                      ->14
    8     8    >   COUNT                                            ~10     !0
          9      > JMPZ                                                     ~10, ->13
    9    10    >   NEW                                              $11     'Exception'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $11
    7    13    >   PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 100000
         15      > JMPNZ                                                    ~14, ->8
   12    16    >   INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !3, $15
   13    20        ASSIGN                                                   !1, 0
         21      > JMP                                                      ->29
   14    22    >   ISSET_ISEMPTY_CV                                 ~18     !0
         23        BOOL_NOT                                         ~19     ~18
         24      > JMPZ                                                     ~19, ->28
   15    25    >   NEW                                              $20     'Exception'
         26        DO_FCALL                                      0          
         27      > THROW                                         0          $20
   13    28    >   PRE_INC                                                  !1
         29    >   IS_SMALLER                                               !1, 100000
         30      > JMPNZ                                                    ~23, ->22
   18    31    >   INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $24     
         34        ASSIGN                                                   !4, $24
   20    35        SUB                                              ~26     !3, !2
         36        CONCAT                                           ~27     ~26, '%0A'
         37        ECHO                                                     ~27
   21    38        SUB                                              ~28     !4, !3
         39        CONCAT                                           ~29     ~28, '%0A'
         40        ECHO                                                     ~29
   23    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.54 ms | 1400 KiB | 15 Q