<?php class NonLeakingClass { } //echo "Test empty object memory leakage" . PHP_EOL; // WARNING: Uncomment this line and PHP stops to leak memory on object creation, strange :) for ($h = 0; $h < 5; $h++) { var_dump(memory_get_usage(false)); $a = new NonLeakingClass(); unset($a); gc_collect_cycles(); var_dump(memory_get_usage(false)); } exit;
You have javascript disabled. You will not be able to edit any code.