3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vars = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'); $start = microtime(true); for($k=0;$k<100;$k++) { $str = ltrim(strrev(chunk_split(implode(array_reverse($vars)), 3, ';')),';'); } $end = microtime(true); echo $end - $start; echo "\n\n"; $start = microtime(true); for($k=0;$k<100;$k++) { $size = sizeOf($vars); for ($i = $size-3; $i > 0; $i-=3) { array_splice($vars,$i,0,";"); } } $end = microtime(true); echo $end - $start;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 7
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 42
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 47
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 42
Branch analysis from position: 59
Branch analysis from position: 42
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 47
Branch analysis from position: 56
Branch analysis from position: 47
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 7
Branch analysis from position: 29
Branch analysis from position: 7
filename:       /in/augiS
function name:  (null)
number of ops:  66
compiled vars:  !0 = $vars, !1 = $start, !2 = $k, !3 = $str, !4 = $end, !5 = $size, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $8      
          4        ASSIGN                                                   !1, $8
    5     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->27
    6     7    >   INIT_FCALL                                               'ltrim'
          8        INIT_FCALL                                               'strrev'
          9        INIT_FCALL                                               'chunk_split'
         10        INIT_FCALL                                               'implode'
         11        INIT_FCALL                                               'array_reverse'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $11     
         14        SEND_VAR                                                 $11
         15        DO_ICALL                                         $12     
         16        SEND_VAR                                                 $12
         17        SEND_VAL                                                 3
         18        SEND_VAL                                                 '%3B'
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        SEND_VAL                                                 '%3B'
         24        DO_ICALL                                         $15     
         25        ASSIGN                                                   !3, $15
    5    26        PRE_INC                                                  !2
         27    >   IS_SMALLER                                               !2, 100
         28      > JMPNZ                                                    ~18, ->7
    8    29    >   INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !4, $19
    9    33        SUB                                              ~21     !4, !1
         34        ECHO                                                     ~21
   11    35        ECHO                                                     '%0A%0A'
   13    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $22     
         39        ASSIGN                                                   !1, $22
   14    40        ASSIGN                                                   !2, 0
         41      > JMP                                                      ->57
   15    42    >   COUNT                                            ~25     !0
         43        ASSIGN                                                   !5, ~25
   16    44        SUB                                              ~27     !5, 3
         45        ASSIGN                                                   !6, ~27
         46      > JMP                                                      ->54
   17    47    >   INIT_FCALL                                               'array_splice'
         48        SEND_REF                                                 !0
         49        SEND_VAR                                                 !6
         50        SEND_VAL                                                 0
         51        SEND_VAL                                                 '%3B'
         52        DO_ICALL                                                 
   16    53        ASSIGN_OP                                     2          !6, 3
         54    >   IS_SMALLER                                               0, !6
         55      > JMPNZ                                                    ~31, ->47
   14    56    >   PRE_INC                                                  !2
         57    >   IS_SMALLER                                               !2, 100
         58      > JMPNZ                                                    ~33, ->42
   20    59    >   INIT_FCALL                                               'microtime'
         60        SEND_VAL                                                 <true>
         61        DO_ICALL                                         $34     
         62        ASSIGN                                                   !4, $34
   21    63        SUB                                              ~36     !4, !1
         64        ECHO                                                     ~36
         65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.82 ms | 1400 KiB | 27 Q