3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Aself { protected static function g0() { } public static function get() { return self::g0(); } } class Astatic { protected static function g0() { } public static function get() { return static::g0(); } } $t = microtime(true); for ($i = 0; $i < 10000; $i++) { Aself::get(); } echo microtime(true) - $t; echo "\n"; $t = microtime(true); for ($i = 0; $i < 10000; $i++) { Astatic::get(); } echo microtime(true) - $t; echo "\n";
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 = 6
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
Branch analysis from position: 23
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/JpYtb
function name:  (null)
number of ops:  35
compiled vars:  !0 = $t, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   22     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->9
   23     6    >   INIT_STATIC_METHOD_CALL                                  'Aself', 'get'
          7        DO_FCALL                                      0          
   22     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 10000
         10      > JMPNZ                                                    ~7, ->6
   25    11    >   INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $8      
         14        SUB                                              ~9      $8, !0
         15        ECHO                                                     ~9
   26    16        ECHO                                                     '%0A'
   28    17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !0, $10
   29    21        ASSIGN                                                   !1, 0
         22      > JMP                                                      ->26
   30    23    >   INIT_STATIC_METHOD_CALL                                  'Astatic', 'get'
         24        DO_FCALL                                      0          
   29    25        PRE_INC                                                  !1
         26    >   IS_SMALLER                                               !1, 10000
         27      > JMPNZ                                                    ~15, ->23
   33    28    >   INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $16     
         31        SUB                                              ~17     $16, !0
         32        ECHO                                                     ~17
   34    33        ECHO                                                     '%0A'
         34      > RETURN                                                   1

Class Aself:
Function g0:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JpYtb
function name:  g0
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function g0

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JpYtb
function name:  get
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'g0'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function get

End of class Aself.

Class Astatic:
Function g0:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JpYtb
function name:  g0
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   null

End of function g0

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JpYtb
function name:  get
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'g0'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   18     3*     > RETURN                                                   null

End of function get

End of class Astatic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.03 ms | 1400 KiB | 15 Q