3v4l.org

run code in 300+ PHP versions simultaneously
<?php class F { private string $bar; public function __construct(private string $foo, string $bar){ $this->bar = $bar; } public function __sleep(): array { return array_keys(get_object_vars($this)); } public function getFoo():string { return $this->foo; } public function getBar():string { return $this->bar; } } $g = new F('this is a private variable', 'so is this'); $s = serialize($g); var_export($s); $n = unserialize($s); echo \PHP_EOL; echo $n->getFoo(); echo \PHP_EOL; echo $n->getBar();

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.120.0050.00320.86
8.3.110.0030.00520.94
8.3.100.0040.00424.06
8.3.90.0030.00626.77
8.3.80.0070.00718.56
8.3.70.0120.00618.55
8.3.60.0040.01118.43
8.3.50.0070.01118.28
8.3.40.0100.00320.04
8.3.30.0110.00418.50
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0000.00726.16
8.2.240.0080.00017.27
8.2.230.0080.00022.58
8.2.220.0050.00337.54
8.2.210.0110.00426.77
8.2.200.0060.00318.88
8.2.190.0120.00416.60
8.2.180.0150.00616.63
8.2.170.0130.00319.09
8.2.160.0110.00322.96
8.2.150.0000.01025.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0070.00021.18
8.2.110.0130.00622.07
8.2.100.0220.00020.99
8.2.90.0210.01418.69
8.2.80.0200.01318.81
8.2.70.0310.00318.72
8.2.60.0290.00418.72
8.2.50.0180.00719.91
8.2.40.0220.00418.78
8.2.30.0260.01018.52
8.2.20.0160.00920.15
8.2.10.0220.00719.03
8.2.00.0160.01018.91
8.1.300.0000.00918.38
8.1.290.0000.00830.84
8.1.280.0070.01425.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0220.00318.67
8.1.230.0120.00318.48
8.1.220.0130.00318.49
8.1.210.0110.00319.65
8.1.200.0140.01118.60
8.1.190.0120.00318.38
8.1.180.0150.00018.30
8.1.170.0140.00018.41
8.1.160.0000.01318.73
8.1.150.0080.00520.49
8.1.140.0110.00318.38
8.1.130.0220.00618.41
8.1.120.0090.00318.50
8.1.110.0130.00019.60
8.1.100.0220.00318.27
8.1.90.0100.01618.48
8.1.80.0080.00818.55
8.1.70.0090.00418.75
8.1.60.0140.00518.70
8.1.50.0120.00418.50
8.1.40.0090.00318.79
8.1.30.0090.00318.98
8.1.20.0130.00318.63
8.1.10.0130.00018.82
8.1.00.0110.00318.74
8.0.300.0230.00318.00
8.0.290.0100.01717.90
8.0.280.0190.00617.89
8.0.270.0200.01017.82
8.0.260.0110.01118.38
8.0.250.0190.00818.07
8.0.240.0190.00017.83
8.0.230.0280.00018.22
8.0.220.0280.00717.58
8.0.210.0190.01317.86
8.0.200.0270.01017.79
8.0.190.0100.00318.09
8.0.180.0180.00617.67
8.0.170.0150.00018.07
8.0.160.0150.00018.00
8.0.150.0150.00317.74
8.0.140.0110.00417.93
8.0.130.0130.01318.07
8.0.120.0300.00317.89
8.0.110.0150.00018.07
8.0.100.0150.00017.79
8.0.90.0150.00317.87
8.0.80.0080.00817.88
8.0.70.0140.00017.88
8.0.60.0120.00018.23
8.0.50.0260.00717.63
8.0.30.0220.00618.20
8.0.20.0180.00717.85
8.0.10.0130.00318.04

preferences:
22.07 ms | 403 KiB | 5 Q