3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 1000000; $strOne = '1'; $strEmpty = ''; $times = ['oneOpEq' => 0, 'oneSlen' => 0, 'empOpEq' => 0, 'empSlen' => 0]; $x = $iterations; $start = microtime(true); while ($x--) { $y = ($strOne === '1'); } $times['oneOpEq'] = microtime(true) - $start; $x = $iterations; $start = microtime(true); while ($x--) { $y = (strlen($strOne) == 0); } $times['oneSlen'] = microtime(true) - $start; $x = $iterations; $start = microtime(true); while ($x--) { $y = ($strEmpty === ''); } $times['empOpEq'] = microtime(true) - $start; $x = $iterations; $start = microtime(true); while ($x--) { $y = (strlen($strEmpty) == 0); } $times['empSlen'] = microtime(true) - $start; var_dump($times);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 10
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 26
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 43
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 59
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 59
Branch analysis from position: 64
Branch analysis from position: 59
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 43
Branch analysis from position: 47
Branch analysis from position: 43
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 26
Branch analysis from position: 31
Branch analysis from position: 26
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 10
Branch analysis from position: 14
Branch analysis from position: 10
filename:       /in/ralL8
function name:  (null)
number of ops:  74
compiled vars:  !0 = $iterations, !1 = $strOne, !2 = $strEmpty, !3 = $times, !4 = $x, !5 = $start, !6 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1000000
    5     1        ASSIGN                                                   !1, '1'
    6     2        ASSIGN                                                   !2, ''
    8     3        ASSIGN                                                   !3, <array>
   15     4        ASSIGN                                                   !4, !0
   16     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $12     
          8        ASSIGN                                                   !5, $12
   17     9      > JMP                                                      ->12
         10    >   IS_IDENTICAL                                     ~14     !1, '1'
         11        ASSIGN                                                   !6, ~14
         12    >   POST_DEC                                         ~16     !4
         13      > JMPNZ                                                    ~16, ->10
   18    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $18     
         17        SUB                                              ~19     $18, !5
         18        ASSIGN_DIM                                               !3, 'oneOpEq'
         19        OP_DATA                                                  ~19
   21    20        ASSIGN                                                   !4, !0
   22    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $21     
         24        ASSIGN                                                   !5, $21
   23    25      > JMP                                                      ->29
         26    >   STRLEN                                           ~23     !1
         27        IS_EQUAL                                         ~24     ~23, 0
         28        ASSIGN                                                   !6, ~24
         29    >   POST_DEC                                         ~26     !4
         30      > JMPNZ                                                    ~26, ->26
   24    31    >   INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $28     
         34        SUB                                              ~29     $28, !5
         35        ASSIGN_DIM                                               !3, 'oneSlen'
         36        OP_DATA                                                  ~29
   27    37        ASSIGN                                                   !4, !0
   28    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $31     
         41        ASSIGN                                                   !5, $31
   29    42      > JMP                                                      ->45
         43    >   IS_IDENTICAL                                     ~33     !2, ''
         44        ASSIGN                                                   !6, ~33
         45    >   POST_DEC                                         ~35     !4
         46      > JMPNZ                                                    ~35, ->43
   30    47    >   INIT_FCALL                                               'microtime'
         48        SEND_VAL                                                 <true>
         49        DO_ICALL                                         $37     
         50        SUB                                              ~38     $37, !5
         51        ASSIGN_DIM                                               !3, 'empOpEq'
         52        OP_DATA                                                  ~38
   33    53        ASSIGN                                                   !4, !0
   34    54        INIT_FCALL                                               'microtime'
         55        SEND_VAL                                                 <true>
         56        DO_ICALL                                         $40     
         57        ASSIGN                                                   !5, $40
   35    58      > JMP                                                      ->62
         59    >   STRLEN                                           ~42     !2
         60        IS_EQUAL                                         ~43     ~42, 0
         61        ASSIGN                                                   !6, ~43
         62    >   POST_DEC                                         ~45     !4
         63      > JMPNZ                                                    ~45, ->59
   36    64    >   INIT_FCALL                                               'microtime'
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $47     
         67        SUB                                              ~48     $47, !5
         68        ASSIGN_DIM                                               !3, 'empSlen'
         69        OP_DATA                                                  ~48
   38    70        INIT_FCALL                                               'var_dump'
         71        SEND_VAR                                                 !3
         72        DO_ICALL                                                 
         73      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.24 ms | 1400 KiB | 17 Q