3v4l.org

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

Class Model: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.7 ms | 1400 KiB | 17 Q