3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 0; $x = []; class person { public $firstname; public $lastname; } $start = microtime( true ); do { $p = new person; $p->firstname = "Patrick"; $p->lastname = "Allaert"; $x[] = $p; ++$i; } while ( $i < 500000 ); echo microtime( true ) - $start, "\n", memory_get_peak_usage(), "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/sX13Z
function name:  (null)
number of ops:  29
compiled vars:  !0 = $i, !1 = $x, !2 = $start, !3 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        ASSIGN                                                   !1, <array>
    8     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   10     6    >   NEW                                              $8      'person'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !3, $8
   11     9        ASSIGN_OBJ                                               !3, 'firstname'
         10        OP_DATA                                                  'Patrick'
   12    11        ASSIGN_OBJ                                               !3, 'lastname'
         12        OP_DATA                                                  'Allaert'
   13    13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  !3
   14    15        PRE_INC                                                  !0
   15    16        IS_SMALLER                                               !0, 500000
         17      > JMPNZ                                                    ~15, ->6
   16    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $16     
         21        SUB                                              ~17     $16, !2
         22        ECHO                                                     ~17
         23        ECHO                                                     '%0A'
         24        INIT_FCALL                                               'memory_get_peak_usage'
         25        DO_ICALL                                         $18     
         26        ECHO                                                     $18
         27        ECHO                                                     '%0A'
         28      > RETURN                                                   1

Class person: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.68 ms | 1395 KiB | 17 Q