3v4l.org

run code in 500+ PHP versions simultaneously
<?php function createInstance() { return new class {}; } $startMemory = memory_get_peak_usage(); for ($i = 0; $i < 10000; $i++) { createInstance(); } var_dump((memory_get_peak_usage() - $startMemory) / 1024**2); // MB
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
Branch analysis from position: 5
filename:       /in/41UGH
function name:  (null)
number of ops:  18
compiled vars:  !0 = $startMemory, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                                   'memory_get_peak_usage'
          1        DO_ICALL                                             $2      
          2        ASSIGN                                                       !0, $2
    8     3        ASSIGN                                                       !1, 0
          4      > JMP                                                          ->8
    9     5    >   INIT_FCALL                                                   'createinstance'
          6        DO_FCALL                                          0          
    8     7        PRE_INC                                                      !1
          8    >   IS_SMALLER                                                   !1, 10000
          9      > JMPNZ                                                        ~7, ->5
   11    10    >   INIT_FCALL                                                   'var_dump'
         11        INIT_FCALL                                                   'memory_get_peak_usage'
         12        DO_ICALL                                             $8      
         13        SUB                                                  ~9      $8, !0
         14        DIV                                                  ~10     ~9, 1048576
         15        SEND_VAL                                                     ~10
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Function createinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41UGH
function name:  createInstance
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   DECLARE_ANON_CLASS                                   4294967295  
          1        NEW                                                  $1      $0
          2        DO_FCALL                                          0          
          3      > RETURN                                                       $1
    5     4*     > RETURN                                                       null

End of function createinstance

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.74 ms | 1710 KiB | 16 Q