3v4l.org

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

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.08 ms | 1400 KiB | 15 Q