3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=62468 class SelfLinked { public $xml; public $me; public function __construct() { $this->xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?> <a><b><c><d><e><f><g><h><i><j><k><l><m><n><o><p><q><r><s><t><u><v><w><x><y><z>waa? </z></y></x></w></v></u></t></s></r></q></p></o></n></m></l></k></j></i></h></g></f></e></d></c></b></a>'); $this->me = $this; } } $b = memory_get_usage(); for ($i = 0; $i < 1000; $i++) { new SelfLinked(); } if (function_exists('gc_collect_cycles')) gc_collect_cycles(); var_dump(memory_get_usage() - $b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/Qqk4p
function name:  (null)
number of ops:  24
compiled vars:  !0 = $b, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
   20     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->9
   22     5    >   NEW                                              $5      'SelfLinked'
          6        DO_FCALL                                      0          
          7        FREE                                                     $5
   20     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 1000
         10      > JMPNZ                                                    ~8, ->5
   25    11    >   INIT_FCALL                                               'function_exists'
         12        SEND_VAL                                                 'gc_collect_cycles'
         13        DO_ICALL                                         $9      
         14      > JMPZ                                                     $9, ->17
   26    15    >   INIT_FCALL                                               'gc_collect_cycles'
         16        DO_ICALL                                                 
   28    17    >   INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'memory_get_usage'
         19        DO_ICALL                                         $11     
         20        SUB                                              ~12     $11, !0
         21        SEND_VAL                                                 ~12
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Class SelfLinked:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qqk4p
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'simplexml_load_string'
          1        SEND_VAL                                                 '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Ca%3E%3Cb%3E%3Cc%3E%3Cd%3E%3Ce%3E%3Cf%3E%3Cg%3E%3Ch%3E%3Ci%3E%3Cj%3E%3Ck%3E%3Cl%3E%3Cm%3E%3Cn%3E%3Co%3E%3Cp%3E%3Cq%3E%3Cr%3E%3Cs%3E%3Ct%3E%3Cu%3E%3Cv%3E%3Cw%3E%3Cx%3E%3Cy%3E%3Cz%3Ewaa%3F%0A%3C%2Fz%3E%3C%2Fy%3E%3C%2Fx%3E%3C%2Fw%3E%3C%2Fv%3E%3C%2Fu%3E%3C%2Ft%3E%3C%2Fs%3E%3C%2Fr%3E%3C%2Fq%3E%3C%2Fp%3E%3C%2Fo%3E%3C%2Fn%3E%3C%2Fm%3E%3C%2Fl%3E%3C%2Fk%3E%3C%2Fj%3E%3C%2Fi%3E%3C%2Fh%3E%3C%2Fg%3E%3C%2Ff%3E%3C%2Fe%3E%3C%2Fd%3E%3C%2Fc%3E%3C%2Fb%3E%3C%2Fa%3E'
          2        DO_ICALL                                         $1      
          3        ASSIGN_OBJ                                               'xml'
          4        OP_DATA                                                  $1
   14     5        FETCH_THIS                                       ~3      
          6        ASSIGN_OBJ                                               'me'
          7        OP_DATA                                                  ~3
   15     8      > RETURN                                                   null

End of function __construct

End of class SelfLinked.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.69 ms | 1400 KiB | 23 Q