3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create a test DOMDocument $doc = new DOMDocument(); $elements = []; // Create a test DOMElement $root = $doc->createElement('root'); $doc->appendChild($root); for ($i = 0; $i < 25000; $i++) { $element = $doc->createElement('testElement'); $elements[] = $element; } echo "Memory usage: " . memory_get_usage(true) / (1024 * 1024) . " MB\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 13
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 13
Branch analysis from position: 22
Branch analysis from position: 13
filename:       /in/Aoi63
function name:  (null)
number of ops:  30
compiled vars:  !0 = $doc, !1 = $elements, !2 = $root, !3 = $i, !4 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $5      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    5     3        ASSIGN                                                   !1, <array>
    7     4        INIT_METHOD_CALL                                         !0, 'createElement'
          5        SEND_VAL_EX                                              'root'
          6        DO_FCALL                                      0  $9      
          7        ASSIGN                                                   !2, $9
    8     8        INIT_METHOD_CALL                                         !0, 'appendChild'
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0          
   10    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->20
   11    13    >   INIT_METHOD_CALL                                         !0, 'createElement'
         14        SEND_VAL_EX                                              'testElement'
         15        DO_FCALL                                      0  $13     
         16        ASSIGN                                                   !4, $13
   12    17        ASSIGN_DIM                                               !1
         18        OP_DATA                                                  !4
   10    19        PRE_INC                                                  !3
         20    >   IS_SMALLER                                               !3, 25000
         21      > JMPNZ                                                    ~17, ->13
   15    22    >   INIT_FCALL                                               'memory_get_usage'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $18     
         25        DIV                                              ~19     $18, 1048576
         26        CONCAT                                           ~20     'Memory+usage%3A+', ~19
         27        CONCAT                                           ~21     ~20, '+MB%0A'
         28        ECHO                                                     ~21
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.08 ms | 1003 KiB | 14 Q