3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $_field = "abcdefghijklmnopqrstuvwxyz"; public function __construct() {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new A(); $time_taken = microtime(true) - $start; echo 'With construct: ' . $time_taken . 's' . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new B(); $time_taken = microtime(true) - $start; echo 'Without construct: ' . $time_taken . 's' . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 27
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 27
Branch analysis from position: 33
Branch analysis from position: 27
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/AXs5N
function name:  (null)
number of ops:  43
compiled vars:  !0 = $start, !1 = $i, !2 = $r, !3 = $time_taken
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   15     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->10
          6    >   NEW                                              $7      'A'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $7
          9        PRE_INC                                                  !1
         10    >   IS_SMALLER                                               !1, 100000
         11      > JMPNZ                                                    ~11, ->6
   16    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $12     
         15        SUB                                              ~13     $12, !0
         16        ASSIGN                                                   !3, ~13
   18    17        CONCAT                                           ~15     'With+construct%3A++++', !3
         18        CONCAT                                           ~16     ~15, 's'
         19        CONCAT                                           ~17     ~16, '%0A'
         20        ECHO                                                     ~17
   20    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $18     
         24        ASSIGN                                                   !0, $18
   21    25        ASSIGN                                                   !1, 0
         26      > JMP                                                      ->31
         27    >   NEW                                              $21     'B'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !2, $21
         30        PRE_INC                                                  !1
         31    >   IS_SMALLER                                               !1, 100000
         32      > JMPNZ                                                    ~25, ->27
   22    33    >   INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $26     
         36        SUB                                              ~27     $26, !0
         37        ASSIGN                                                   !3, ~27
   24    38        CONCAT                                           ~29     'Without+construct%3A+', !3
         39        CONCAT                                           ~30     ~29, 's'
         40        CONCAT                                           ~31     ~30, '%0A'
         41        ECHO                                                     ~31
         42      > RETURN                                                   1

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

End of function __construct

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.32 ms | 1400 KiB | 15 Q