3v4l.org

run code in 300+ 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 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 26
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 59
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 61
Branch analysis from position: 72
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 59
Branch analysis from position: 75
Branch analysis from position: 59
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 61
Branch analysis from position: 72
Branch analysis from position: 61
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 28
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 26
Branch analysis from position: 42
Branch analysis from position: 26
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 28
Branch analysis from position: 39
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:  85
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.3.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                                                      ->40
   16    26    >   ASSIGN                                                   !1, 0
         27      > JMP                                                      ->37
   17    28    >   FETCH_DIM_R                                      ~20     !0, !1
         29        ASSIGN                                                   !6, ~20
   18    30        INIT_FCALL                                               'preg_match'
         31        SEND_VAL                                                 '%7E%7Eu'
         32        SEND_VAR                                                 !6
         33        DO_ICALL                                         $22     
         34        TYPE_CHECK                                  1018  ~23     $22
         35        FREE                                                     ~23
   16    36        PRE_INC                                                  !1
         37    >   IS_SMALLER                                               !1, 1000
         38      > JMPNZ                                                    ~25, ->28
   15    39    >   PRE_INC                                                  !5
         40    >   IS_SMALLER                                               !5, !3
         41      > JMPNZ                                                    ~27, ->26
   21    42    >   INIT_FCALL                                               'printf'
         43        SEND_VAL                                                 'Took+%25.7f+seconds+per+execution%0A'
         44        INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $28     
         47        SUB                                              ~29     $28, !4
         48        DIV                                              ~30     ~29, !3
         49        SEND_VAL                                                 ~30
         50        DO_ICALL                                                 
   23    51        ECHO                                                     '%0A'
   26    52        ASSIGN                                                   !3, 100
   27    53        INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 <true>
         55        DO_ICALL                                         $33     
         56        ASSIGN                                                   !4, $33
   28    57        ASSIGN                                                   !5, 0
         58      > JMP                                                      ->73
   29    59    >   ASSIGN                                                   !1, 0
         60      > JMP                                                      ->70
   30    61    >   FETCH_DIM_R                                      ~37     !0, !1
         62        ASSIGN                                                   !6, ~37
   31    63        INIT_FCALL                                               'mb_check_encoding'
         64        SEND_VAR                                                 !6
         65        SEND_VAL                                                 'UTF-8'
         66        DO_ICALL                                         $39     
         67        TYPE_CHECK                                  1018  ~40     $39
         68        FREE                                                     ~40
   29    69        PRE_INC                                                  !1
         70    >   IS_SMALLER                                               !1, 1000
         71      > JMPNZ                                                    ~42, ->61
   28    72    >   PRE_INC                                                  !5
         73    >   IS_SMALLER                                               !5, !3
         74      > JMPNZ                                                    ~44, ->59
   34    75    >   INIT_FCALL                                               'printf'
         76        SEND_VAL                                                 'Took+%25.7f+seconds+per+execution%0A'
         77        INIT_FCALL                                               'microtime'
         78        SEND_VAL                                                 <true>
         79        DO_ICALL                                         $45     
         80        SUB                                              ~46     $45, !4
         81        DIV                                              ~47     ~46, !3
         82        SEND_VAL                                                 ~47
         83        DO_ICALL                                                 
         84      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149 ms | 1012 KiB | 19 Q