3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = ''; for ($i = 0; $i < 100000; ++$i) { // 10 MB $s .= rand(0, 9); } $s .= $s . $s . $s . $s . $s . $s . $s . $s . $s; // 100Mb echo "data: " . mb_strlen($s) / (1024 * 1024) . " Mb"; $start = microtime(true); for ($i = 0; $i < 1000; ++$i) { mb_strlen($s); } $end = microtime(true); echo "result = " . ($end - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 33
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 33
Branch analysis from position: 39
Branch analysis from position: 33
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
Branch analysis from position: 3
filename:       /in/9EuUT
function name:  (null)
number of ops:  47
compiled vars:  !0 = $s, !1 = $i, !2 = $start, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->9
    7     3    >   INIT_FCALL                                               'rand'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 9
          6        DO_ICALL                                         $6      
          7        ASSIGN_OP                                     8          !0, $6
    5     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 100000
         10      > JMPNZ                                                    ~9, ->3
   10    11    >   CONCAT                                           ~10     !0, !0
         12        CONCAT                                           ~11     ~10, !0
         13        CONCAT                                           ~12     ~11, !0
         14        CONCAT                                           ~13     ~12, !0
         15        CONCAT                                           ~14     ~13, !0
         16        CONCAT                                           ~15     ~14, !0
         17        CONCAT                                           ~16     ~15, !0
         18        CONCAT                                           ~17     ~16, !0
         19        ASSIGN_OP                                     8          !0, ~17
   12    20        INIT_FCALL                                               'mb_strlen'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $19     
         23        DIV                                              ~20     $19, 1048576
         24        CONCAT                                           ~21     'data%3A+', ~20
         25        CONCAT                                           ~22     ~21, '+Mb'
         26        ECHO                                                     ~22
   14    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $23     
         30        ASSIGN                                                   !2, $23
   15    31        ASSIGN                                                   !1, 0
         32      > JMP                                                      ->37
   17    33    >   INIT_FCALL                                               'mb_strlen'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
   15    36        PRE_INC                                                  !1
         37    >   IS_SMALLER                                               !1, 1000
         38      > JMPNZ                                                    ~28, ->33
   19    39    >   INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $29     
         42        ASSIGN                                                   !3, $29
   21    43        SUB                                              ~31     !3, !2
         44        CONCAT                                           ~32     'result+%3D+', ~31
         45        ECHO                                                     ~32
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.84 ms | 1400 KiB | 19 Q