3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "before allocation: ".memory_get_usage(true).PHP_EOL; $object = str_repeat("\0", 1000000); echo "after allocation: ".memory_get_usage(true).PHP_EOL; $object2 = $object; echo "after assignment: ".memory_get_usage(true).PHP_EOL; $object3 =& $object; echo "after reference assignment: ".memory_get_usage(true).PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFXAM
function name:  (null)
number of ops:  32
compiled vars:  !0 = $object, !1 = $object2, !2 = $object3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        CONCAT                                           ~4      'before+allocation%3A+', $3
          4        CONCAT                                           ~5      ~4, '%0A'
          5        ECHO                                                     ~5
    5     6        INIT_FCALL                                               'str_repeat'
          7        SEND_VAL                                                 '%00'
          8        SEND_VAL                                                 1000000
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !0, $6
    7    11        INIT_FCALL                                               'memory_get_usage'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $8      
         14        CONCAT                                           ~9      'after+allocation%3A+', $8
         15        CONCAT                                           ~10     ~9, '%0A'
         16        ECHO                                                     ~10
    9    17        ASSIGN                                                   !1, !0
   11    18        INIT_FCALL                                               'memory_get_usage'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $12     
         21        CONCAT                                           ~13     'after+assignment%3A+', $12
         22        CONCAT                                           ~14     ~13, '%0A'
         23        ECHO                                                     ~14
   13    24        ASSIGN_REF                                               !2, !0
   15    25        INIT_FCALL                                               'memory_get_usage'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $16     
         28        CONCAT                                           ~17     'after+reference+assignment%3A+', $16
         29        CONCAT                                           ~18     ~17, '%0A'
         30        ECHO                                                     ~18
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.24 ms | 1396 KiB | 17 Q