3v4l.org

run code in 500+ PHP versions simultaneously
<?php printf("%s\n", PHP_VERSION); echo "\n"; $data = []; $i = 1000; $byteLength = 10000; while ($i--) { $data[] = base64_encode(random_bytes($byteLength)); } // PCRE $max = 100; $start = microtime(true); for ($c = 0; $c < $max; $c++) { for ($i = 0; $i < 1000; $i++) { $value = $data[$i]; false !== preg_match('~~u', $value); } } printf("Took %.7f seconds per execution\n", (microtime(true) - $start) / $max); echo "\n"; // mbstring $max = 100; $start = microtime(true); for ($c = 0; $c < $max; $c++) { for ($i = 0; $i < 1000; $i++) { $value = $data[$i]; false !== mb_check_encoding($value, 'UTF-8'); } } printf("Took %.7f seconds per execution\n", (microtime(true) - $start) / $max);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 9
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 26
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 56
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 58
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 56
Branch analysis from position: 72
Branch analysis from position: 56
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 58
Branch analysis from position: 69
Branch analysis from position: 58
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 28
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 26
Branch analysis from position: 39
Branch analysis from position: 26
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 28
Branch analysis from position: 36
Branch analysis from position: 28
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 9
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/1Ghji
function name:  (null)
number of ops:  82
compiled vars:  !0 = $data, !1 = $i, !2 = $byteLength, !3 = $max, !4 = $start, !5 = $c, !6 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'printf'
          1        SEND_VAL                                                     '%25s%0A'
          2        SEND_VAL                                                     '8.5.0'
          3        DO_ICALL                                                     
    4     4        ECHO                                                         '%0A'
    5     5        ASSIGN                                                       !0, <array>
    6     6        ASSIGN                                                       !1, 1000
    7     7        ASSIGN                                                       !2, 10000
    8     8      > JMP                                                          ->17
    9     9    >   INIT_FCALL                                                   'base64_encode'
         10        INIT_FCALL                                                   'random_bytes'
         11        SEND_VAR                                                     !2
         12        DO_ICALL                                             $12     
         13        SEND_VAR                                                     $12
         14        DO_ICALL                                             $13     
         15        ASSIGN_DIM                                                   !0
         16        OP_DATA                                                      $13
    8    17    >   POST_DEC                                             ~14     !1
         18      > JMPNZ                                                        ~14, ->9
   13    19    >   ASSIGN                                                       !3, 100
   14    20        INIT_FCALL                                                   'microtime'
         21        SEND_VAL                                                     <true>
         22        DO_ICALL                                             $16     
         23        ASSIGN                                                       !4, $16
   15    24        ASSIGN                                                       !5, 0
         25      > JMP                                                          ->37
   16    26    >   ASSIGN                                                       !1, 0
         27      > JMP                                                          ->34
   17    28    >   FETCH_DIM_R                                          ~20     !0, !1
         29        ASSIGN                                                       !6, ~20
   18    30        FRAMELESS_ICALL_2                preg_match          ~22     '%7E%7Eu', !6
         31        TYPE_CHECK                                      1018  ~23     ~22
         32        FREE                                                         ~23
   16    33        PRE_INC                                                      !1
         34    >   IS_SMALLER                                                   !1, 1000
         35      > JMPNZ                                                        ~25, ->28
   15    36    >   PRE_INC                                                      !5
         37    >   IS_SMALLER                                                   !5, !3
         38      > JMPNZ                                                        ~27, ->26
   21    39    >   INIT_FCALL                                                   'printf'
         40        SEND_VAL                                                     'Took+%25.7f+seconds+per+execution%0A'
         41        INIT_FCALL                                                   'microtime'
         42        SEND_VAL                                                     <true>
         43        DO_ICALL                                             $28     
         44        SUB                                                  ~29     $28, !4
         45        DIV                                                  ~30     ~29, !3
         46        SEND_VAL                                                     ~30
         47        DO_ICALL                                                     
   23    48        ECHO                                                         '%0A'
   26    49        ASSIGN                                                       !3, 100
   27    50        INIT_FCALL                                                   'microtime'
         51        SEND_VAL                                                     <true>
         52        DO_ICALL                                             $33     
         53        ASSIGN                                                       !4, $33
   28    54        ASSIGN                                                       !5, 0
         55      > JMP                                                          ->70
   29    56    >   ASSIGN                                                       !1, 0
         57      > JMP                                                          ->67
   30    58    >   FETCH_DIM_R                                          ~37     !0, !1
         59        ASSIGN                                                       !6, ~37
   31    60        INIT_FCALL                                                   'mb_check_encoding'
         61        SEND_VAR                                                     !6
         62        SEND_VAL                                                     'UTF-8'
         63        DO_ICALL                                             $39     
         64        TYPE_CHECK                                      1018  ~40     $39
         65        FREE                                                         ~40
   29    66        PRE_INC                                                      !1
         67    >   IS_SMALLER                                                   !1, 1000
         68      > JMPNZ                                                        ~42, ->58
   28    69    >   PRE_INC                                                      !5
         70    >   IS_SMALLER                                                   !5, !3
         71      > JMPNZ                                                        ~44, ->56
   34    72    >   INIT_FCALL                                                   'printf'
         73        SEND_VAL                                                     'Took+%25.7f+seconds+per+execution%0A'
         74        INIT_FCALL                                                   'microtime'
         75        SEND_VAL                                                     <true>
         76        DO_ICALL                                             $45     
         77        SUB                                                  ~46     $45, !4
         78        DIV                                                  ~47     ~46, !3
         79        SEND_VAL                                                     ~47
         80        DO_ICALL                                                     
         81      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.5 ms | 1301 KiB | 18 Q