3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.59 ms | 1404 KiB | 15 Q