3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); for ($i = 0; $i <= 10000000; $i++) { chr(0); } $time2 = microtime(true); echo $time2 - $time; echo "\r\n"; class FOO { const BAR = ''; public function stats() { $time = microtime(true); for ($i = 0; $i <= 10000000; $i++) { self::BAR; } $time2 = microtime(true); echo $time2 - $time; } } $foo = new FOO(); $foo->stats();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/vkjKg
function name:  (null)
number of ops:  22
compiled vars:  !0 = $time, !1 = $i, !2 = $time2, !3 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->7
          6    >   PRE_INC                                                  !1
          7    >   IS_SMALLER_OR_EQUAL                                      !1, 10000000
          8      > JMPNZ                                                    ~8, ->6
    7     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
    8    13        SUB                                              ~11     !2, !0
         14        ECHO                                                     ~11
   10    15        ECHO                                                     '%0D%0A'
   24    16        NEW                                              $12     'FOO'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !3, $12
   25    19        INIT_METHOD_CALL                                         !3, 'stats'
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

Class FOO:
Function stats:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 6
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/vkjKg
function name:  stats
number of ops:  16
compiled vars:  !0 = $time, !1 = $i, !2 = $time2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
   16     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->7
          6    >   PRE_INC                                                  !1
          7    >   IS_SMALLER_OR_EQUAL                                      !1, 10000000
          8      > JMPNZ                                                    ~7, ->6
   19     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
   20    13        SUB                                              ~10     !2, !0
         14        ECHO                                                     ~10
   21    15      > RETURN                                                   null

End of function stats

End of class FOO.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.7 ms | 1400 KiB | 15 Q