3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 5; private $b = 10; private $c = 15; private $d = 20; } $instances = []; $s = microtime(true); for ($i = 0; $i < 1000000; $i++) { $instances[] = new A(); } var_dump(microtime(true) - $s); $instances = []; $instance = new A(); $s = microtime(true); for ($i = 0; $i < 1000000; $i++) { $instances[] = clone $instance; } var_dump(microtime(true) - $s);
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 = 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 31
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 31
Branch analysis from position: 37
Branch analysis from position: 31
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/Z7P4M
function name:  (null)
number of ops:  45
compiled vars:  !0 = $instances, !1 = $s, !2 = $i, !3 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   13     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->12
   14     7    >   NEW                                              $9      'A'
          8        DO_FCALL                                      0          
          9        ASSIGN_DIM                                               !0
         10        OP_DATA                                                  $9
   13    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 1000000
         13      > JMPNZ                                                    ~12, ->7
   16    14    >   INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $13     
         18        SUB                                              ~14     $13, !1
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                                 
   18    21        ASSIGN                                                   !0, <array>
   19    22        NEW                                              $17     'A'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !3, $17
   20    25        INIT_FCALL                                               'microtime'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $20     
         28        ASSIGN                                                   !1, $20
   21    29        ASSIGN                                                   !2, 0
         30      > JMP                                                      ->35
   22    31    >   CLONE                                            ~24     !3
         32        ASSIGN_DIM                                               !0
         33        OP_DATA                                                  ~24
   21    34        PRE_INC                                                  !2
         35    >   IS_SMALLER                                               !2, 1000000
         36      > JMPNZ                                                    ~26, ->31
   24    37    >   INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $27     
         41        SUB                                              ~28     $27, !1
         42        SEND_VAL                                                 ~28
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.7 ms | 1392 KiB | 17 Q