3v4l.org

run code in 300+ PHP versions simultaneously
<?php $md5=md5(''); for($i=0;$i<10000;$i++){ $t=microtime(true);preg_match("#$md5#i",'ff'); $a[]=microtime(true)-$t; } // Remove the first and last iterations array_shift($a); array_pop($a); // Print the average cost of each function call printf("Average preg_match on md5() = %.6f seconds\n",array_sum($a)/count($a)); for($i=0;$i<10000;$i++){ $t=microtime(true); filter_var('0x'.$md5,FILTER_VALIDATE_INT,FILTER_FLAG_ALLOW_HEX); $b[]=microtime(true)-$t; } // Remove the first and last iterations array_shift($b); array_pop($b); // Print the average cost of each function call printf("Average filter_var on md5() = %.6f seconds\n",array_sum($b)/count($b));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 43
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 43
Branch analysis from position: 62
Branch analysis from position: 43
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
Branch analysis from position: 6
filename:       /in/n8YgC
function name:  (null)
number of ops:  78
compiled vars:  !0 = $md5, !1 = $i, !2 = $t, !3 = $a, !4 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'md5'
          1        SEND_VAL                                                 ''
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    3     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->24
    4     6    >   INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
         10        INIT_FCALL                                               'preg_match'
         11        ROPE_INIT                                     3  ~11     '%23'
         12        ROPE_ADD                                      1  ~11     ~11, !0
         13        ROPE_END                                      2  ~10     ~11, '%23i'
         14        SEND_VAL                                                 ~10
         15        SEND_VAL                                                 'ff'
         16        DO_ICALL                                                 
    5    17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $15     
         20        SUB                                              ~16     $15, !2
         21        ASSIGN_DIM                                               !3
         22        OP_DATA                                                  ~16
    3    23        PRE_INC                                                  !1
         24    >   IS_SMALLER                                               !1, 10000
         25      > JMPNZ                                                    ~18, ->6
    8    26    >   INIT_FCALL                                               'array_shift'
         27        SEND_REF                                                 !3
         28        DO_ICALL                                                 
    9    29        INIT_FCALL                                               'array_pop'
         30        SEND_REF                                                 !3
         31        DO_ICALL                                                 
   11    32        INIT_FCALL                                               'printf'
         33        SEND_VAL                                                 'Average+preg_match+on+md5%28%29+%3D+%25.6f+seconds%0A'
         34        INIT_FCALL                                               'array_sum'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                         $21     
         37        COUNT                                            ~22     !3
         38        DIV                                              ~23     $21, ~22
         39        SEND_VAL                                                 ~23
         40        DO_ICALL                                                 
   13    41        ASSIGN                                                   !1, 0
         42      > JMP                                                      ->60
   14    43    >   INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $26     
         46        ASSIGN                                                   !2, $26
   15    47        INIT_FCALL                                               'filter_var'
         48        CONCAT                                           ~28     '0x', !0
         49        SEND_VAL                                                 ~28
         50        SEND_VAL                                                 257
         51        SEND_VAL                                                 2
         52        DO_ICALL                                                 
   16    53        INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 <true>
         55        DO_ICALL                                         $31     
         56        SUB                                              ~32     $31, !2
         57        ASSIGN_DIM                                               !4
         58        OP_DATA                                                  ~32
   13    59        PRE_INC                                                  !1
         60    >   IS_SMALLER                                               !1, 10000
         61      > JMPNZ                                                    ~34, ->43
   19    62    >   INIT_FCALL                                               'array_shift'
         63        SEND_REF                                                 !4
         64        DO_ICALL                                                 
   20    65        INIT_FCALL                                               'array_pop'
         66        SEND_REF                                                 !4
         67        DO_ICALL                                                 
   22    68        INIT_FCALL                                               'printf'
         69        SEND_VAL                                                 'Average+filter_var+on+md5%28%29+%3D+%25.6f+seconds%0A'
         70        INIT_FCALL                                               'array_sum'
         71        SEND_VAR                                                 !4
         72        DO_ICALL                                         $37     
         73        COUNT                                            ~38     !4
         74        DIV                                              ~39     $37, ~38
         75        SEND_VAL                                                 ~39
         76        DO_ICALL                                                 
         77      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.49 ms | 1400 KiB | 29 Q