3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Foo {} $foo = new Foo; $rounds = 1000000; $start = microtime(true); for($i=0; $i<$rounds; $i++) { get_class($foo); } echo (microtime(true) - $start); echo "\n"; $reflectionClass = new ReflectionClass($foo); $start = microtime(true); for($i=0; $i<$rounds; $i++) { $reflectionClass->getName(); } echo (microtime(true) - $start); echo "\n"; $start = microtime(true); for($i=0; $i<$rounds; $i++) { (new ReflectionClass($foo))->getName(); } echo (microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 16
Branch analysis from position: 16
Jump found. Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Jump found. Position 1 = 38
Branch analysis from position: 38
Jump found. Position 1 = 40, Position 2 = 34
Branch analysis from position: 40
Jump found. Position 1 = 59
Branch analysis from position: 59
Jump found. Position 1 = 61, Position 2 = 52
Branch analysis from position: 61
Jump found. Position 1 = -2
Branch analysis from position: 52
Jump found. Position 1 = 61, Position 2 = 52
Branch analysis from position: 61
Branch analysis from position: 52
Branch analysis from position: 34
Jump found. Position 1 = 40, Position 2 = 34
Branch analysis from position: 40
Branch analysis from position: 34
Branch analysis from position: 11
Jump found. Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Branch analysis from position: 11
filename:       /in/33CgB
function name:  (null)
number of ops:  67
compiled vars:  !0 = $foo, !1 = $rounds, !2 = $start, !3 = $i, !4 = $reflectionClass
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   5     1        NEW                                              $6      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $6
   7     4        ASSIGN                                                   !1, 1000000
   9     5        INIT_FCALL                                               'microtime'
         6        SEND_VAL                                                 <true>
         7        DO_ICALL                                         $10     
         8        ASSIGN                                                   !2, $10
  10     9        ASSIGN                                                   !3, 0
        10      > JMP                                                      ->16
  11    11    >   INIT_FCALL                                               'get_class'
        12        SEND_VAR                                                 !0
        13        DO_ICALL                                                 
  10    14        POST_INC                                         ~14     !3
        15        FREE                                                     ~14
        16    >   IS_SMALLER                                       ~15     !3, !1
        17      > JMPNZ                                                    ~15, ->11
  13    18    >   INIT_FCALL                                               'microtime'
        19        SEND_VAL                                                 <true>
        20        DO_ICALL                                         $16     
        21        SUB                                              ~17     $16, !2
        22        ECHO                                                     ~17
  15    23        ECHO                                                     '%0A'
  17    24        NEW                                              $18     :4
        25        SEND_VAR_EX                                              !0
        26        DO_FCALL                                      0          
        27        ASSIGN                                                   !4, $18
  18    28        INIT_FCALL                                               'microtime'
        29        SEND_VAL                                                 <true>
        30        DO_ICALL                                         $21     
        31        ASSIGN                                                   !2, $21
  19    32        ASSIGN                                                   !3, 0
        33      > JMP                                                      ->38
  20    34    >   INIT_METHOD_CALL                                         !4, 'getName'
        35        DO_FCALL                                      0          
  19    36        POST_INC                                         ~25     !3
        37        FREE                                                     ~25
        38    >   IS_SMALLER                                       ~26     !3, !1
        39      > JMPNZ                                                    ~26, ->34
  22    40    >   INIT_FCALL                                               'microtime'
        41        SEND_VAL                                                 <true>
        42        DO_ICALL                                         $27     
        43        SUB                                              ~28     $27, !2
        44        ECHO                                                     ~28
  24    45        ECHO                                                     '%0A'
  26    46        INIT_FCALL                                               'microtime'
        47        SEND_VAL                                                 <true>
        48        DO_ICALL                                         $29     
        49        ASSIGN                                                   !2, $29
  27    50        ASSIGN                                                   !3, 0
        51      > JMP                                                      ->59
  28    52    >   NEW                                              $32     :17
        53        SEND_VAR_EX                                              !0
        54        DO_FCALL                                      0          
        55        INIT_METHOD_CALL                                         $32, 'getName'
        56        DO_FCALL                                      0          
  27    57        POST_INC                                         ~35     !3
        58        FREE                                                     ~35
        59    >   IS_SMALLER                                       ~36     !3, !1
        60      > JMPNZ                                                    ~36, ->52
  30    61    >   INIT_FCALL                                               'microtime'
        62        SEND_VAL                                                 <true>
        63        DO_ICALL                                         $37     
        64        SUB                                              ~38     $37, !2
        65        ECHO                                                     ~38
        66      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.3.0