3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array('potato', 'salad', 'salad_rel'); $start_time = microtime(TRUE); for ($i = 0; $i < 10000; $i++){ foreach ($test as $string){ substr($string, -4) == '_rel'; } } $end_time = microtime(TRUE); echo $end_time - $start_time; $start_time = microtime(TRUE); for ($i = 0; $i < 10000; $i++){ foreach ($test as $string){ preg_match('#.{1,}_rel$#', $string); } } $end_time = microtime(TRUE); echo $end_time - $start_time;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 32
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 32
Branch analysis from position: 43
Branch analysis from position: 32
Branch analysis from position: 39
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
Branch analysis from position: 16
filename:       /in/jhVjq
function name:  (null)
number of ops:  50
compiled vars:  !0 = $test, !1 = $start_time, !2 = $i, !3 = $string, !4 = $end_time
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                                         $6      
          4        ASSIGN                                                   !1, $6
    6     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->18
    7     7    > > FE_RESET_R                                       $9      !0, ->16
          8    > > FE_FETCH_R                                               $9, !3, ->16
    8     9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !3
         11        SEND_VAL                                                 -4
         12        DO_ICALL                                         $10     
         13        IS_EQUAL                                         ~11     $10, '_rel'
         14        FREE                                                     ~11
    7    15      > JMP                                                      ->8
         16    >   FE_FREE                                                  $9
    6    17        PRE_INC                                                  !2
         18    >   IS_SMALLER                                               !2, 10000
         19      > JMPNZ                                                    ~13, ->7
   11    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !4, $14
   12    24        SUB                                              ~16     !4, !1
         25        ECHO                                                     ~16
   14    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !1, $17
   16    30        ASSIGN                                                   !2, 0
         31      > JMP                                                      ->41
   17    32    > > FE_RESET_R                                       $20     !0, ->39
         33    > > FE_FETCH_R                                               $20, !3, ->39
   18    34    >   INIT_FCALL                                               'preg_match'
         35        SEND_VAL                                                 '%23.%7B1%2C%7D_rel%24%23'
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                                 
   17    38      > JMP                                                      ->33
         39    >   FE_FREE                                                  $20
   16    40        PRE_INC                                                  !2
         41    >   IS_SMALLER                                               !2, 10000
         42      > JMPNZ                                                    ~23, ->32
   21    43    >   INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $24     
         46        ASSIGN                                                   !4, $24
   22    47        SUB                                              ~26     !4, !1
         48        ECHO                                                     ~26
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.75 ms | 1400 KiB | 19 Q