3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.27 ms | 1400 KiB | 15 Q