3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('NUM_ITERATIONS', 10000000); $var = NULL; // Profile is_null. $time = time(); for ($i = 0; $i < NUM_ITERATIONS; $i++) { is_null($var); } print (time() - $time) . ' elapsed seconds.' . PHP_EOL; // Profile (bool) $time = time(); for ($i = 0; $i < NUM_ITERATIONS; $i++) { (bool) $var; } print (time() - $time) . ' elapsed seconds.' . PHP_EOL; // Profile isset $time = time(); for ($i = 0; $i < NUM_ITERATIONS; $i++) { isset($var); } print (time() - $time) . ' elapsed seconds.' . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
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 = 32, Position 2 = 27
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 43
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 43
Branch analysis from position: 49
Branch analysis from position: 43
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 27
Branch analysis from position: 32
Branch analysis from position: 27
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
Branch analysis from position: 10
filename:       /in/duY2W
function name:  (null)
number of ops:  56
compiled vars:  !0 = $var, !1 = $time, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'NUM_ITERATIONS'
          2        SEND_VAL                                                 10000000
          3        DO_ICALL                                                 
    5     4        ASSIGN                                                   !0, null
    8     5        INIT_FCALL                                               'time'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    9     8        ASSIGN                                                   !2, 0
          9      > JMP                                                      ->13
         10    >   TYPE_CHECK                                    2  ~8      !0
         11        FREE                                                     ~8
         12        PRE_INC                                                  !2
         13    >   FETCH_CONSTANT                                   ~10     'NUM_ITERATIONS'
         14        IS_SMALLER                                               !2, ~10
         15      > JMPNZ                                                    ~11, ->10
   10    16    >   INIT_FCALL                                               'time'
         17        DO_ICALL                                         $12     
         18        SUB                                              ~13     $12, !1
         19        CONCAT                                           ~14     ~13, '+elapsed+seconds.'
         20        CONCAT                                           ~15     ~14, '%0A'
         21        ECHO                                                     ~15
   13    22        INIT_FCALL                                               'time'
         23        DO_ICALL                                         $16     
         24        ASSIGN                                                   !1, $16
   14    25        ASSIGN                                                   !2, 0
         26      > JMP                                                      ->29
         27    >   BOOL                                             ~19     !0
         28        PRE_INC                                                  !2
         29    >   FETCH_CONSTANT                                   ~21     'NUM_ITERATIONS'
         30        IS_SMALLER                                               !2, ~21
         31      > JMPNZ                                                    ~22, ->27
   15    32    >   INIT_FCALL                                               'time'
         33        DO_ICALL                                         $23     
         34        SUB                                              ~24     $23, !1
         35        CONCAT                                           ~25     ~24, '+elapsed+seconds.'
         36        CONCAT                                           ~26     ~25, '%0A'
         37        ECHO                                                     ~26
   18    38        INIT_FCALL                                               'time'
         39        DO_ICALL                                         $27     
         40        ASSIGN                                                   !1, $27
   19    41        ASSIGN                                                   !2, 0
         42      > JMP                                                      ->46
         43    >   ISSET_ISEMPTY_CV                                 ~30     !0
         44        FREE                                                     ~30
         45        PRE_INC                                                  !2
         46    >   FETCH_CONSTANT                                   ~32     'NUM_ITERATIONS'
         47        IS_SMALLER                                               !2, ~32
         48      > JMPNZ                                                    ~33, ->43
   20    49    >   INIT_FCALL                                               'time'
         50        DO_ICALL                                         $34     
         51        SUB                                              ~35     $34, !1
         52        CONCAT                                           ~36     ~35, '+elapsed+seconds.'
         53        CONCAT                                           ~37     ~36, '%0A'
         54        ECHO                                                     ~37
         55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.71 ms | 1400 KiB | 17 Q