3v4l.org

run code in 300+ PHP versions simultaneously
<?php $context = array('test' => true); // optionally fill-in the test value with lots of data for ($i = 0; $i < 100000; $i++) { $context['test'][$i] = $i; } // you can also just create a big string // $context = str_repeat(' ', 1000000); // benchmark $time = microtime(true); for ($i = 0; $i < 100; $i++) { // the snippet of code to benchmark $tmp = isset($context['test']) ? $context['test'] : ''; } printf("TIME: %0.2d\n", (microtime(true) - $time) * 1000) . PHP_EOL; // benchmark $time = microtime(true); for ($i = 0; $i < 100; $i++) { // the snippet of code to benchmark $tmp = ''; if (isset($context['test'])) { $tmp = $context['test']; } } printf("TIME: %0.2d\n", (microtime(true) - $time) * 1000);
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 = 3
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 42
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 42
Branch analysis from position: 50
Branch analysis from position: 42
Branch analysis from position: 47
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
Branch analysis from position: 15
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
Branch analysis from position: 15
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/5dBZG
function name:  (null)
number of ops:  60
compiled vars:  !0 = $context, !1 = $i, !2 = $time, !3 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
    7     3    >   FETCH_DIM_W                                      $6      !0, 'test'
          4        ASSIGN_DIM                                               $6, !1
          5        OP_DATA                                                  !1
    6     6        PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 100000
          8      > JMPNZ                                                    ~9, ->3
   13     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
   14    13        ASSIGN                                                   !1, 0
         14      > JMP                                                      ->23
   16    15    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'test'
         16      > JMPZ                                                     ~13, ->20
         17    >   FETCH_DIM_R                                      ~14     !0, 'test'
         18        QM_ASSIGN                                        ~15     ~14
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~15     ''
         21    >   ASSIGN                                                   !3, ~15
   14    22        PRE_INC                                                  !1
         23    >   IS_SMALLER                                               !1, 100
         24      > JMPNZ                                                    ~18, ->15
   18    25    >   INIT_FCALL                                               'printf'
         26        SEND_VAL                                                 'TIME%3A+%250.2d%0A'
         27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $19     
         30        SUB                                              ~20     $19, !2
         31        MUL                                              ~21     ~20, 1000
         32        SEND_VAL                                                 ~21
         33        DO_ICALL                                         $22     
         34        CONCAT                                           ~23     $22, '%0A'
         35        FREE                                                     ~23
   21    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $24     
         39        ASSIGN                                                   !2, $24
   22    40        ASSIGN                                                   !1, 0
         41      > JMP                                                      ->48
   24    42    >   ASSIGN                                                   !3, ''
   25    43        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'test'
         44      > JMPZ                                                     ~28, ->47
   26    45    >   FETCH_DIM_R                                      ~29     !0, 'test'
         46        ASSIGN                                                   !3, ~29
   22    47    >   PRE_INC                                                  !1
         48    >   IS_SMALLER                                               !1, 100
         49      > JMPNZ                                                    ~32, ->42
   29    50    >   INIT_FCALL                                               'printf'
         51        SEND_VAL                                                 'TIME%3A+%250.2d%0A'
         52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $33     
         55        SUB                                              ~34     $33, !2
         56        MUL                                              ~35     ~34, 1000
         57        SEND_VAL                                                 ~35
         58        DO_ICALL                                                 
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.76 ms | 1400 KiB | 17 Q