3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = str_repeat('a', 1 * 1024 * 1024); echo 'Memory usage start: ' . memory_get_usage() . PHP_EOL; echo '$x is: ' . gettype($x) . PHP_EOL; do_unset( $x ); echo 'Memory usage after do_unset: ' . memory_get_usage() . PHP_EOL; echo '$x is: ' . gettype($x) . PHP_EOL; do_null( $x ); echo 'Memory usage after do_null: ' . memory_get_usage() . PHP_EOL; echo '$x is: ' . gettype($x) . PHP_EOL; function do_unset( & $x ) { unset($x); } function do_null( & $x ) { $x = null; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2nSE
function name:  (null)
number of ops:  39
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'str_repeat'
          1        SEND_VAL                                                 'a'
          2        SEND_VAL                                                 1048576
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    4     5        INIT_FCALL                                               'memory_get_usage'
          6        DO_ICALL                                         $3      
          7        CONCAT                                           ~4      'Memory+usage+start%3A+', $3
          8        CONCAT                                           ~5      ~4, '%0A'
          9        ECHO                                                     ~5
    5    10        GET_TYPE                                         ~6      !0
         11        CONCAT                                           ~7      '%24x+is%3A+', ~6
         12        CONCAT                                           ~8      ~7, '%0A'
         13        ECHO                                                     ~8
    7    14        INIT_FCALL_BY_NAME                                       'do_unset'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
    8    17        INIT_FCALL                                               'memory_get_usage'
         18        DO_ICALL                                         $10     
         19        CONCAT                                           ~11     'Memory+usage+after+do_unset%3A+', $10
         20        CONCAT                                           ~12     ~11, '%0A'
         21        ECHO                                                     ~12
    9    22        GET_TYPE                                         ~13     !0
         23        CONCAT                                           ~14     '%24x+is%3A+', ~13
         24        CONCAT                                           ~15     ~14, '%0A'
         25        ECHO                                                     ~15
   11    26        INIT_FCALL_BY_NAME                                       'do_null'
         27        SEND_VAR_EX                                              !0
         28        DO_FCALL                                      0          
   12    29        INIT_FCALL                                               'memory_get_usage'
         30        DO_ICALL                                         $17     
         31        CONCAT                                           ~18     'Memory+usage+after+do_null%3A+', $17
         32        CONCAT                                           ~19     ~18, '%0A'
         33        ECHO                                                     ~19
   13    34        GET_TYPE                                         ~20     !0
         35        CONCAT                                           ~21     '%24x+is%3A+', ~20
         36        CONCAT                                           ~22     ~21, '%0A'
         37        ECHO                                                     ~22
   23    38      > RETURN                                                   1

Function do_unset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2nSE
function name:  do_unset
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        UNSET_CV                                                 !0
   18     2      > RETURN                                                   null

End of function do_unset

Function do_null:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2nSE
function name:  do_null
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        ASSIGN                                                   !0, null
   23     2      > RETURN                                                   null

End of function do_null

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.49 ms | 1400 KiB | 17 Q