3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rot13($str) { for ($i = 0,$l = strlen($str);$i<$l;$i++) { $str[$i] = chr(((ord($str[$i])-84)%26)+97); } return $str; } $d = '';$i=$e=0; $start = microtime(1); while($i++ < 500000) $d = str_rot13('rotate 13'); echo microtime(1) - $start; echo "\n"; $d = ''; $start = microtime(1); while($e++ < 500000) $d = rot13('rotate 13'); echo microtime(1) - $start;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 8
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 27
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 27
Branch analysis from position: 34
Branch analysis from position: 27
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 8
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/fB9j3
function name:  (null)
number of ops:  40
compiled vars:  !0 = $d, !1 = $i, !2 = $e, !3 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, ''
          1        ASSIGN                                           ~5      !2, 0
          2        ASSIGN                                                   !1, ~5
   10     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !3, $7
   11     7      > JMP                                                      ->12
          8    >   INIT_FCALL                                               'str_rot13'
          9        SEND_VAL                                                 'rotate+13'
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !0, $9
         12    >   POST_INC                                         ~11     !1
         13        IS_SMALLER                                               ~11, 500000
         14      > JMPNZ                                                    ~12, ->8
   12    15    >   INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $13     
         18        SUB                                              ~14     $13, !3
         19        ECHO                                                     ~14
   13    20        ECHO                                                     '%0A'
   15    21        ASSIGN                                                   !0, ''
   16    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !3, $16
   17    26      > JMP                                                      ->31
         27    >   INIT_FCALL                                               'rot13'
         28        SEND_VAL                                                 'rotate+13'
         29        DO_FCALL                                      0  $18     
         30        ASSIGN                                                   !0, $18
         31    >   POST_INC                                         ~20     !2
         32        IS_SMALLER                                               ~20, 500000
         33      > JMPNZ                                                    ~21, ->27
   18    34    >   INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 1
         36        DO_ICALL                                         $22     
         37        SUB                                              ~23     $22, !3
         38        ECHO                                                     ~23
         39      > RETURN                                                   1

Function rot13:
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 = 5
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
Branch analysis from position: 5
filename:       /in/fB9j3
function name:  rot13
number of ops:  22
compiled vars:  !0 = $str, !1 = $i, !2 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 0
          2        STRLEN                                           ~4      !0
          3        ASSIGN                                                   !2, ~4
          4      > JMP                                                      ->18
    4     5    >   INIT_FCALL                                               'chr'
          6        INIT_FCALL                                               'ord'
          7        FETCH_DIM_R                                      ~7      !0, !1
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        SUB                                              ~9      $8, 84
         11        MOD                                              ~10     ~9, 26
         12        ADD                                              ~11     ~10, 97
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                         $12     
         15        ASSIGN_DIM                                               !0, !1
         16        OP_DATA                                                  $12
    3    17        PRE_INC                                                  !1
         18    >   IS_SMALLER                                               !1, !2
         19      > JMPNZ                                                    ~14, ->5
    6    20    > > RETURN                                                   !0
    7    21*     > RETURN                                                   null

End of function rot13

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.83 ms | 1403 KiB | 22 Q