3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.91 ms | 1400 KiB | 19 Q