3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = 'fgdsahktyrewagfbdhzbvt74tf.gfdhsgfghsdf.gsdfhjgfdsg.gsfdghfdsh.dtasfghsdghg.tar.gz'; $t1 = microtime(true); for ($i = 0; $i < 100000; ++$i) { $e1 = substr($filename, strrpos($filename, '.') + 1); } $t2 = microtime(true); for ($n = 0; $n < 100000; ++$n) { $e2 = pathinfo($filename, \PATHINFO_EXTENSION); } $t3 = microtime(true); for ($j = 0; $j < 100000; ++$j) { $e3 = substr(strrchr($filename, '.'), 1); } $t4 = microtime(true); echo '1: ' . ($t2-$t1), PHP_EOL; echo '2: ' . ($t3-$t2), PHP_EOL; echo '3: ' . ($t4-$t3), 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 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 26
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 40
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 40
Branch analysis from position: 52
Branch analysis from position: 40
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 26
Branch analysis from position: 34
Branch analysis from position: 26
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
filename:       /in/Be0iY
function name:  (null)
number of ops:  69
compiled vars:  !0 = $filename, !1 = $t1, !2 = $i, !3 = $e1, !4 = $t2, !5 = $n, !6 = $e2, !7 = $t3, !8 = $j, !9 = $e3, !10 = $t4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'fgdsahktyrewagfbdhzbvt74tf.gfdhsgfghsdf.gsdfhjgfdsg.gsfdghfdsh.dtasfghsdghg.tar.gz'
    6     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $12     
          4        ASSIGN                                                   !1, $12
    7     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->18
    8     7    >   INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        INIT_FCALL                                               'strrpos'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '.'
         12        DO_ICALL                                         $15     
         13        ADD                                              ~16     $15, 1
         14        SEND_VAL                                                 ~16
         15        DO_ICALL                                         $17     
         16        ASSIGN                                                   !3, $17
    7    17        PRE_INC                                                  !2
         18    >   IS_SMALLER                                               !2, 100000
         19      > JMPNZ                                                    ~20, ->7
   10    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $21     
         23        ASSIGN                                                   !4, $21
   11    24        ASSIGN                                                   !5, 0
         25      > JMP                                                      ->32
   12    26    >   INIT_FCALL                                               'pathinfo'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 4
         29        DO_ICALL                                         $24     
         30        ASSIGN                                                   !6, $24
   11    31        PRE_INC                                                  !5
         32    >   IS_SMALLER                                               !5, 100000
         33      > JMPNZ                                                    ~27, ->26
   14    34    >   INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $28     
         37        ASSIGN                                                   !7, $28
   15    38        ASSIGN                                                   !8, 0
         39      > JMP                                                      ->50
   16    40    >   INIT_FCALL                                               'substr'
         41        INIT_FCALL                                               'strrchr'
         42        SEND_VAR                                                 !0
         43        SEND_VAL                                                 '.'
         44        DO_ICALL                                         $31     
         45        SEND_VAR                                                 $31
         46        SEND_VAL                                                 1
         47        DO_ICALL                                         $32     
         48        ASSIGN                                                   !9, $32
   15    49        PRE_INC                                                  !8
         50    >   IS_SMALLER                                               !8, 100000
         51      > JMPNZ                                                    ~35, ->40
   18    52    >   INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $36     
         55        ASSIGN                                                   !10, $36
   20    56        SUB                                              ~38     !4, !1
         57        CONCAT                                           ~39     '1%3A+', ~38
         58        ECHO                                                     ~39
         59        ECHO                                                     '%0A'
   21    60        SUB                                              ~40     !7, !4
         61        CONCAT                                           ~41     '2%3A+', ~40
         62        ECHO                                                     ~41
         63        ECHO                                                     '%0A'
   22    64        SUB                                              ~42     !10, !7
         65        CONCAT                                           ~43     '3%3A+', ~42
         66        ECHO                                                     ~43
         67        ECHO                                                     '%0A'
   23    68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.45 ms | 1436 KiB | 18 Q