3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = microtime(true); for($i=0; $i<100000; $i++) { $foo = "foo"; $bar = "bar"; $baz = "baz"; $array = compact('foo','bar','baz'); } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "With compact : $elapsed seconds\n"; $startTime = microtime(true); for($i=0; $i<100000; $i++) { $foo = "foo"; $bar = "bar"; $baz = "baz"; $array = [ 'foo' => $foo, 'bar' => $bar, 'baz' => $baz ]; } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "Without compact time : $elapsed seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 34
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 34
Branch analysis from position: 44
Branch analysis from position: 34
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
Branch analysis from position: 6
filename:       /in/e0Amo
function name:  (null)
number of ops:  55
compiled vars:  !0 = $startTime, !1 = $i, !2 = $foo, !3 = $bar, !4 = $baz, !5 = $array, !6 = $endTime, !7 = $elapsed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !0, $8
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->16
    6     6    >   ASSIGN                                                   !2, 'foo'
    7     7        ASSIGN                                                   !3, 'bar'
    8     8        ASSIGN                                                   !4, 'baz'
   10     9        INIT_FCALL                                               'compact'
         10        SEND_VAL                                                 'foo'
         11        SEND_VAL                                                 'bar'
         12        SEND_VAL                                                 'baz'
         13        DO_ICALL                                         $14     
         14        ASSIGN                                                   !5, $14
    5    15        PRE_INC                                                  !1
         16    >   IS_SMALLER                                               !1, 100000
         17      > JMPNZ                                                    ~17, ->6
   13    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $18     
         21        ASSIGN                                                   !6, $18
   14    22        SUB                                              ~20     !6, !0
         23        ASSIGN                                                   !7, ~20
   16    24        ROPE_INIT                                     3  ~23     'With+compact+%3A+'
         25        ROPE_ADD                                      1  ~23     ~23, !7
         26        ROPE_END                                      2  ~22     ~23, '+seconds%0A'
         27        ECHO                                                     ~22
   20    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $25     
         31        ASSIGN                                                   !0, $25
   22    32        ASSIGN                                                   !1, 0
         33      > JMP                                                      ->42
   23    34    >   ASSIGN                                                   !2, 'foo'
   24    35        ASSIGN                                                   !3, 'bar'
   25    36        ASSIGN                                                   !4, 'baz'
   27    37        INIT_ARRAY                                       ~31     !2, 'foo'
   28    38        ADD_ARRAY_ELEMENT                                ~31     !3, 'bar'
   29    39        ADD_ARRAY_ELEMENT                                ~31     !4, 'baz'
   26    40        ASSIGN                                                   !5, ~31
   22    41        PRE_INC                                                  !1
         42    >   IS_SMALLER                                               !1, 100000
         43      > JMPNZ                                                    ~34, ->34
   33    44    >   INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $35     
         47        ASSIGN                                                   !6, $35
   34    48        SUB                                              ~37     !6, !0
         49        ASSIGN                                                   !7, ~37
   36    50        ROPE_INIT                                     3  ~40     'Without+compact+time+%3A+'
         51        ROPE_ADD                                      1  ~40     ~40, !7
         52        ROPE_END                                      2  ~39     ~40, '+seconds%0A'
         53        ECHO                                                     ~39
         54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.58 ms | 1004 KiB | 15 Q