3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 1 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === strlen(str_repeat('x', 1024 * 256))); } echo microtime(true) - $time . "\n"; // 2 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === strlen(str_repeat('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 1024))); } echo microtime(true) - $time . "\n"; // 3 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === sizeof(array_fill(0, 1024 * 256, 1))); } echo microtime(true) - $time . "\n"; // 4 $time = microtime(true); for($i = 0; $i < 10000; $i++) { assert(1024 * 256 === strlen(implode('', array_fill(0, 1024 * 256, 1)))); } echo microtime(true) - $time . "\n";
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 = 6
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 32
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 44) Position 1 = 73, Position 2 = 58
Branch analysis from position: 73
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 85
Branch analysis from position: 104
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 85
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 85
Branch analysis from position: 104
Branch analysis from position: 85
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 73, Position 2 = 58
Branch analysis from position: 73
Branch analysis from position: 58
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 32
Branch analysis from position: 46
Branch analysis from position: 32
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
filename:       /in/jb6VJ
function name:  (null)
number of ops:  111
compiled vars:  !0 = $time, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->18
    6     6    >   ASSERT_CHECK                                             
          7        INIT_FCALL                                               'assert'
          8        INIT_FCALL                                               'str_repeat'
          9        SEND_VAL                                                 'x'
         10        SEND_VAL                                                 262144
         11        DO_ICALL                                         $5      
         12        STRLEN                                           ~6      $5
         13        IS_IDENTICAL                                     ~7      ~6, 262144
         14        SEND_VAL                                                 ~7
         15        SEND_VAL                                                 'assert%281024+%2A+256+%3D%3D%3D+strlen%28str_repeat%28%27x%27%2C+1024+%2A+256%29%29%29'
         16        DO_ICALL                                                 
    5    17        PRE_INC                                                  !1
         18    >   IS_SMALLER                                               !1, 10000
         19      > JMPNZ                                                    ~10, ->6
    8    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $11     
         23        SUB                                              ~12     $11, !0
         24        CONCAT                                           ~13     ~12, '%0A'
         25        ECHO                                                     ~13
   11    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $14     
         29        ASSIGN                                                   !0, $14
   12    30        ASSIGN                                                   !1, 0
         31      > JMP                                                      ->44
   13    32    >   ASSERT_CHECK                                             
         33        INIT_FCALL                                               'assert'
         34        INIT_FCALL                                               'str_repeat'
         35        SEND_VAL                                                 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
         36        SEND_VAL                                                 1024
         37        DO_ICALL                                         $17     
         38        STRLEN                                           ~18     $17
         39        IS_IDENTICAL                                     ~19     ~18, 262144
         40        SEND_VAL                                                 ~19
         41        SEND_VAL                                                 'assert%281024+%2A+256+%3D%3D%3D+strlen%28str_repeat%28%27xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%27%2C+1024%29%29%29'
         42        DO_ICALL                                                 
   12    43        PRE_INC                                                  !1
         44    >   IS_SMALLER                                               !1, 10000
         45      > JMPNZ                                                    ~22, ->32
   15    46    >   INIT_FCALL                                               'microtime'
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $23     
         49        SUB                                              ~24     $23, !0
         50        CONCAT                                           ~25     ~24, '%0A'
         51        ECHO                                                     ~25
   18    52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $26     
         55        ASSIGN                                                   !0, $26
   19    56        ASSIGN                                                   !1, 0
         57      > JMP                                                      ->71
   20    58    >   ASSERT_CHECK                                             
         59        INIT_FCALL                                               'assert'
         60        INIT_FCALL                                               'array_fill'
         61        SEND_VAL                                                 0
         62        SEND_VAL                                                 262144
         63        SEND_VAL                                                 1
         64        DO_ICALL                                         $29     
         65        COUNT                                            ~30     $29
         66        IS_IDENTICAL                                     ~31     ~30, 262144
         67        SEND_VAL                                                 ~31
         68        SEND_VAL                                                 'assert%281024+%2A+256+%3D%3D%3D+sizeof%28array_fill%280%2C+1024+%2A+256%2C+1%29%29%29'
         69        DO_ICALL                                                 
   19    70        PRE_INC                                                  !1
         71    >   IS_SMALLER                                               !1, 10000
         72      > JMPNZ                                                    ~34, ->58
   22    73    >   INIT_FCALL                                               'microtime'
         74        SEND_VAL                                                 <true>
         75        DO_ICALL                                         $35     
         76        SUB                                              ~36     $35, !0
         77        CONCAT                                           ~37     ~36, '%0A'
         78        ECHO                                                     ~37
   25    79        INIT_FCALL                                               'microtime'
         80        SEND_VAL                                                 <true>
         81        DO_ICALL                                         $38     
         82        ASSIGN                                                   !0, $38
   26    83        ASSIGN                                                   !1, 0
         84      > JMP                                                      ->102
   27    85    >   ASSERT_CHECK                                             
         86        INIT_FCALL                                               'assert'
         87        INIT_FCALL                                               'implode'
         88        SEND_VAL                                                 ''
         89        INIT_FCALL                                               'array_fill'
         90        SEND_VAL                                                 0
         91        SEND_VAL                                                 262144
         92        SEND_VAL                                                 1
         93        DO_ICALL                                         $41     
         94        SEND_VAR                                                 $41
         95        DO_ICALL                                         $42     
         96        STRLEN                                           ~43     $42
         97        IS_IDENTICAL                                     ~44     ~43, 262144
         98        SEND_VAL                                                 ~44
         99        SEND_VAL                                                 'assert%281024+%2A+256+%3D%3D%3D+strlen%28implode%28%27%27%2C+array_fill%280%2C+1024+%2A+256%2C+1%29%29%29%29'
        100        DO_ICALL                                                 
   26   101        PRE_INC                                                  !1
        102    >   IS_SMALLER                                               !1, 10000
        103      > JMPNZ                                                    ~47, ->85
   29   104    >   INIT_FCALL                                               'microtime'
        105        SEND_VAL                                                 <true>
        106        DO_ICALL                                         $48     
        107        SUB                                              ~49     $48, !0
        108        CONCAT                                           ~50     ~49, '%0A'
        109        ECHO                                                     ~50
        110      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.67 ms | 1404 KiB | 23 Q