3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends \stdClass { public int $i = 42; public function __unserialize($properties) { foreach ($properties as $key => $property) { $this->$key = $property; } } } $holder = []; for ($i = 0; $i < 10000; $i++) { $holder[] = new A; } var_dump(memory_get_usage()); foreach ($holder as $obj) { } var_dump(memory_get_usage()); $unserialized_holder = []; foreach ($holder as $obj) { $unserialized_holder[] = \unserialize(\serialize($obj)); } unset($holder); var_dump(memory_get_usage());
Output for git.master
int(1339208) int(1339240) int(1470368)
Output for git.master_jit
int(1298888) int(1298920) int(1430048)
Output for rfc.property-hooks
int(1339176) int(1339208) int(1470336)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
29.98 ms | 407 KiB | 5 Q