3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($a = 0; $a < 5; $a++) { $start = microtime(true); for ($i = 0; $i < 10000; $i++) { $args = ['a', 'b']; foreach ($args as $arg) { $arg = (string)$arg; } } echo round(microtime(true) - $start, 5) . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 10000; $i++) { $args = ['a', 'b']; while (count($args)) { $arg = (string)array_shift($args); } } echo round(microtime(true) - $start, 5) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 2
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 8
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 34
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 2
Branch analysis from position: 59
Branch analysis from position: 2
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 36
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 34
Branch analysis from position: 46
Branch analysis from position: 34
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 36
Branch analysis from position: 43
Branch analysis from position: 36
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 8
Branch analysis from position: 18
Branch analysis from position: 8
Branch analysis from position: 14
filename:       /in/JZfqR
function name:  (null)
number of ops:  60
compiled vars:  !0 = $a, !1 = $start, !2 = $i, !3 = $args, !4 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->57
    4     2    >   INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    5     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->16
    6     8    >   ASSIGN                                                   !3, <array>
    7     9      > FE_RESET_R                                       $10     !3, ->14
         10    > > FE_FETCH_R                                               $10, !4, ->14
    8    11    >   CAST                                          6  ~11     !4
         12        ASSIGN                                                   !4, ~11
    7    13      > JMP                                                      ->10
         14    >   FE_FREE                                                  $10
    5    15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, 10000
         17      > JMPNZ                                                    ~14, ->8
   11    18    >   INIT_FCALL                                               'round'
         19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $15     
         22        SUB                                              ~16     $15, !1
         23        SEND_VAL                                                 ~16
         24        SEND_VAL                                                 5
         25        DO_ICALL                                         $17     
         26        CONCAT                                           ~18     $17, '%0A'
         27        ECHO                                                     ~18
   13    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !1, $19
   14    32        ASSIGN                                                   !2, 0
         33      > JMP                                                      ->44
   15    34    >   ASSIGN                                                   !3, <array>
   16    35      > JMP                                                      ->41
   17    36    >   INIT_FCALL                                               'array_shift'
         37        SEND_REF                                                 !3
         38        DO_ICALL                                         $23     
         39        CAST                                          6  ~24     $23
         40        ASSIGN                                                   !4, ~24
   16    41    >   COUNT                                            ~26     !3
         42      > JMPNZ                                                    ~26, ->36
   14    43    >   PRE_INC                                                  !2
         44    >   IS_SMALLER                                               !2, 10000
         45      > JMPNZ                                                    ~28, ->34
   20    46    >   INIT_FCALL                                               'round'
         47        INIT_FCALL                                               'microtime'
         48        SEND_VAL                                                 <true>
         49        DO_ICALL                                         $29     
         50        SUB                                              ~30     $29, !1
         51        SEND_VAL                                                 ~30
         52        SEND_VAL                                                 5
         53        DO_ICALL                                         $31     
         54        CONCAT                                           ~32     $31, '%0A'
         55        ECHO                                                     ~32
    3    56        PRE_INC                                                  !0
         57    >   IS_SMALLER                                               !0, 5
         58      > JMPNZ                                                    ~34, ->2
   21    59    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.34 ms | 1400 KiB | 19 Q