3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = []; $s = microtime(true); for ($i = 0; $i < 100000; $i++) $name = $input['name'] ?? 'John'; var_dump(microtime(true)-$s); $s = microtime(true); for ($i = 0; $i < 100000; $i++) $name = isset($input['name']) ? $input['name']:'John'; var_dump(microtime(true)-$s);
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 = 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 27
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 27
Branch analysis from position: 37
Branch analysis from position: 27
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 27
Branch analysis from position: 37
Branch analysis from position: 27
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/F8I2T
function name:  (null)
number of ops:  45
compiled vars:  !0 = $input, !1 = $s, !2 = $i, !3 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    7     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->12
    8     7    >   FETCH_DIM_IS                                     ~8      !0, 'name'
          8        COALESCE                                         ~9      ~8
          9        QM_ASSIGN                                        ~9      'John'
         10        ASSIGN                                                   !3, ~9
    7    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 100000
         13      > JMPNZ                                                    ~12, ->7
   10    14    >   INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $13     
         18        SUB                                              ~14     $13, !1
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                                 
   13    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $16     
         24        ASSIGN                                                   !1, $16
   15    25        ASSIGN                                                   !2, 0
         26      > JMP                                                      ->35
   16    27    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'name'
         28      > JMPZ                                                     ~19, ->32
         29    >   FETCH_DIM_R                                      ~20     !0, 'name'
         30        QM_ASSIGN                                        ~21     ~20
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~21     'John'
         33    >   ASSIGN                                                   !3, ~21
   15    34        PRE_INC                                                  !2
         35    >   IS_SMALLER                                               !2, 100000
         36      > JMPNZ                                                    ~24, ->27
   18    37    >   INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $25     
         41        SUB                                              ~26     $25, !1
         42        SEND_VAL                                                 ~26
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.35 ms | 1392 KiB | 17 Q