3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} $foo = new Foo; $start = microtime(true); for($i=0; $i<1000000; $i++) { get_class($foo); } echo (microtime(true) - $start); echo "<br>\n"; $start = microtime(true); for($i=0; $i<1000000; $i++) { (new ReflectionClass($foo))->getName(); } echo (microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 26
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 26
Branch analysis from position: 34
Branch analysis from position: 26
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/JWjgR
function name:  (null)
number of ops:  40
compiled vars:  !0 = $foo, !1 = $start, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    7     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
    8     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->12
    9     9    >   GET_CLASS                                        ~9      !0
         10        FREE                                                     ~9
    8    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 1000000
         13      > JMPNZ                                                    ~11, ->9
   11    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $12     
         17        SUB                                              ~13     $12, !1
         18        ECHO                                                     ~13
   13    19        ECHO                                                     '%3Cbr%3E%0A'
   15    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !1, $14
   16    24        ASSIGN                                                   !2, 0
         25      > JMP                                                      ->32
   17    26    >   NEW                                              $17     'ReflectionClass'
         27        SEND_VAR_EX                                              !0
         28        DO_FCALL                                      0          
         29        INIT_METHOD_CALL                                         $17, 'getName'
         30        DO_FCALL                                      0          
   16    31        PRE_INC                                                  !2
         32    >   IS_SMALLER                                               !2, 1000000
         33      > JMPNZ                                                    ~21, ->26
   19    34    >   INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $22     
         37        SUB                                              ~23     $22, !1
         38        ECHO                                                     ~23
         39      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.34 ms | 1400 KiB | 15 Q