SHARE
TWEET

Untitled

a guest Jan 21st, 2013 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ php test1.php
  2. Start
  3. 112
  4. Y
  5. 488
  6. Cleanup
  7. 112
  8. X
  9. 480
  10. Cleanup
  11. 112
  12.  
  13. $ cat test1.php
  14. <?php
  15. class X {
  16.     private $_b;
  17.     private $_e;
  18. }
  19.  
  20. class Y {
  21.     private $_behaviors;
  22.     private $_events;
  23. }
  24.  
  25. $base = memory_get_usage();
  26.  
  27. echo "Start\n";
  28. echo memory_get_usage() - $base."\n";
  29.  
  30. $a = new Y();
  31. $b = new Y();
  32.  
  33. echo "Y\n";
  34. echo memory_get_usage() - $base."\n";
  35.  
  36. unset($a);
  37. unset($b);
  38.  
  39. echo "Cleanup\n";
  40. echo memory_get_usage() - $base."\n";
  41.  
  42. $a = new X();
  43. $b = new X();
  44.  
  45. echo "X\n";
  46. echo memory_get_usage() - $base."\n";
  47.  
  48. unset($a);
  49. unset($b);
  50.  
  51. echo "Cleanup\n";
  52. echo memory_get_usage() - $base."\n";
RAW Paste Data
Top