3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = []; $s = microtime(true); for ($i = 0; $i < 1000000; $i++) $name = isset($input['name']) ? $input['name']:'John'; var_dump(microtime(true)-$s); $s = microtime(true); for ($i = 0; $i < 1000000; $i++) $name = $input['name'] ?? 'John'; var_dump(microtime(true)-$s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 30
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 30
Branch analysis from position: 37
Branch analysis from position: 30
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/rUqnO
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                                                      ->15
    8     7    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'name'
          8      > JMPZ                                                     ~8, ->12
          9    >   FETCH_DIM_R                                      ~9      !0, 'name'
         10        QM_ASSIGN                                        ~10     ~9
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~10     'John'
         13    >   ASSIGN                                                   !3, ~10
    7    14        PRE_INC                                                  !2
         15    >   IS_SMALLER                                               !2, 1000000
         16      > JMPNZ                                                    ~13, ->7
   10    17    >   INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $14     
         21        SUB                                              ~15     $14, !1
         22        SEND_VAL                                                 ~15
         23        DO_ICALL                                                 
   12    24        INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $17     
         27        ASSIGN                                                   !1, $17
   14    28        ASSIGN                                                   !2, 0
         29      > JMP                                                      ->35
   15    30    >   FETCH_DIM_IS                                     ~20     !0, 'name'
         31        COALESCE                                         ~21     ~20
         32        QM_ASSIGN                                        ~21     'John'
         33        ASSIGN                                                   !3, ~21
   14    34        PRE_INC                                                  !2
         35    >   IS_SMALLER                                               !2, 1000000
         36      > JMPNZ                                                    ~24, ->30
   17    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:
144.32 ms | 1400 KiB | 17 Q