3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time_start = microtime(true); for($i = 0; $i < 1000000; $i++) { $arr = []; if(empty($arr) === true) {} } $time_end = microtime(true); $time = $time_end - $time_start; echo "empty() w/ exact comparison: $time seconds\n"; $time_start = microtime(true); for($i = 0; $i < 1000000; $i++) { $arr = []; if($arr === array()) {} } $time_end = microtime(true); $time = $time_end - $time_start; echo "exact comparison to new empty array: $time seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
Branch analysis from position: 29
Branch analysis from position: 32
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
Branch analysis from position: 6
Branch analysis from position: 10
filename:       /in/kIDbg
function name:  (null)
number of ops:  46
compiled vars:  !0 = $time_start, !1 = $i, !2 = $arr, !3 = $time_end, !4 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->11
    6     6    >   ASSIGN                                                   !2, <array>
    7     7        ISSET_ISEMPTY_CV                                 ~9      !2
          8        TYPE_CHECK                                    8          ~9
          9      > JMPZ                                                     ~10, ->10
    5    10    >   PRE_INC                                                  !1
         11    >   IS_SMALLER                                               !1, 1000000
         12      > JMPNZ                                                    ~12, ->6
   10    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !3, $13
   11    17        SUB                                              ~15     !3, !0
         18        ASSIGN                                                   !4, ~15
   13    19        ROPE_INIT                                     3  ~18     'empty%28%29+w%2F+exact+comparison%3A+'
         20        ROPE_ADD                                      1  ~18     ~18, !4
         21        ROPE_END                                      2  ~17     ~18, '+seconds%0A'
         22        ECHO                                                     ~17
   15    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $20     
         26        ASSIGN                                                   !0, $20
   17    27        ASSIGN                                                   !1, 0
         28      > JMP                                                      ->33
   18    29    >   ASSIGN                                                   !2, <array>
   19    30        IS_IDENTICAL                                             !2, <array>
         31      > JMPZ                                                     ~24, ->32
   17    32    >   PRE_INC                                                  !1
         33    >   IS_SMALLER                                               !1, 1000000
         34      > JMPNZ                                                    ~26, ->29
   22    35    >   INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $27     
         38        ASSIGN                                                   !3, $27
   23    39        SUB                                              ~29     !3, !0
         40        ASSIGN                                                   !4, ~29
   25    41        ROPE_INIT                                     3  ~32     'exact+comparison+to+new+empty+array%3A+'
         42        ROPE_ADD                                      1  ~32     ~32, !4
         43        ROPE_END                                      2  ~31     ~32, '+seconds%0A'
         44        ECHO                                                     ~31
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.83 ms | 1003 KiB | 14 Q