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());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.10.0060.02525.67
8.3.00.0160.01622.91
8.2.140.0100.01724.28
8.2.130.0130.01924.30
8.2.120.0100.02123.08
8.2.110.0160.01323.06
8.2.100.0100.02420.89
8.2.90.0070.01720.77
8.2.80.0070.01320.97
8.2.70.0090.01620.47
8.2.60.0150.00920.77
8.2.50.0100.02020.57
8.2.40.0030.01020.84
8.2.30.0000.01420.71
8.2.20.0110.01420.57
8.2.10.0030.01020.65
8.2.00.0110.01420.61
8.1.270.0030.00926.20
8.1.260.0040.00826.23
8.1.250.0130.01026.26
8.1.240.0070.01722.41
8.1.230.0070.02222.65
8.1.220.0070.02123.04
8.1.210.0030.02822.61
8.1.200.0070.02422.61
8.1.190.0100.01722.74
8.1.180.0100.02022.65
8.1.170.0100.00722.60
8.1.160.0100.02022.34
8.1.150.0130.01022.57
8.1.140.0100.01722.54
8.1.130.0040.01122.79
8.1.120.0040.01522.73
8.1.110.0040.00822.60
8.1.100.0000.01422.60
8.1.90.0090.00922.40
8.1.80.0000.01922.75
8.1.70.0000.01522.45
8.1.60.0030.00922.86
8.1.50.0030.00922.74
8.1.40.0030.00922.73
8.1.30.0070.00722.79
8.1.20.0070.01122.83
8.1.10.0040.01522.75
8.1.00.0060.01322.65

preferences:
27.7 ms | 403 KiB | 5 Q