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'); class G extends F {} $s = serialize($g); var_export($s); $n = unserialize($s); echo \PHP_EOL; echo $n->getFoo(); echo \PHP_EOL; echo $n->getBar(); $h = new G('This is an extension', 'of the other one'); $s = serialize($h); echo \PHP_EOL; 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.4.20.0160.00320.55
8.4.10.0030.00619.75
8.3.150.0110.00717.07
8.3.140.0000.00816.78
8.3.130.0030.00718.79
8.3.120.0100.00618.81
8.3.110.0090.00320.94
8.3.100.0040.00424.06
8.3.90.0070.01126.77
8.3.80.0070.00318.43
8.3.70.0150.00016.88
8.3.60.0110.00418.43
8.3.50.0070.01016.75
8.3.40.0070.00720.04
8.3.30.0090.00618.85
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.260.0040.00416.91
8.2.250.0040.00416.89
8.2.240.0080.00017.19
8.2.230.0040.00422.58
8.2.220.0030.00637.54
8.2.210.0120.00326.77
8.2.200.0060.00316.50
8.2.190.0190.00416.75
8.2.180.0140.00716.75
8.2.170.0090.00619.04
8.2.160.0100.00322.96
8.2.150.0060.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00320.94
8.2.110.0030.01722.16
8.2.100.0180.00420.80
8.2.90.0270.00718.75
8.2.80.0200.01018.89
8.2.70.0270.00718.59
8.2.60.0160.01318.81
8.2.50.0220.00319.78
8.2.40.0070.00718.82
8.2.30.0090.00618.77
8.2.20.0240.00318.53
8.2.10.0170.00418.82
8.2.00.0150.00718.95
8.1.310.0110.00716.90
8.1.300.0090.00016.25
8.1.290.0090.00030.84
8.1.280.0090.00625.92
8.1.270.0050.00323.99
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0210.00318.47
8.1.230.0270.00018.57
8.1.220.0090.00418.52
8.1.210.0210.00319.88
8.1.200.0030.01018.38
8.1.190.0190.00618.31
8.1.180.0190.00818.42
8.1.170.0160.01318.31
8.1.160.0140.00018.69
8.1.150.0090.00320.42
8.1.140.0110.01418.17
8.1.130.0100.00518.32
8.1.120.0220.00018.53
8.1.110.0170.00019.59
8.1.100.0110.00418.13
8.1.90.0090.00418.45
8.1.80.0120.00318.56
8.1.70.0110.00518.63
8.1.60.0070.01018.55
8.1.50.0120.00618.52
8.1.40.0070.01018.69
8.1.30.0090.00418.96
8.1.20.0120.00418.94
8.1.10.0130.00318.86
8.1.00.0110.00418.51
8.0.300.0150.00017.79
8.0.290.0090.00617.77
8.0.280.0060.00917.95
8.0.270.0160.00017.81
8.0.260.0120.00018.40
8.0.250.0090.00617.88
8.0.240.0150.00018.01
8.0.230.0090.00318.34
8.0.220.0150.00017.80
8.0.210.0070.00717.82
8.0.200.0080.00817.63
8.0.190.0090.00318.23
8.0.180.0140.00017.92
8.0.170.0150.00017.86
8.0.160.0060.00917.80
8.0.150.0150.00017.83
8.0.140.0150.00017.80
8.0.130.0060.00618.06
8.0.120.0060.00917.94
8.0.110.0100.00317.85
8.0.100.0090.00617.83
8.0.90.0090.00617.88
8.0.80.0130.00317.94
8.0.70.0120.00317.73
8.0.60.0120.00018.23
8.0.50.0100.00517.84
8.0.30.0100.00218.14
8.0.20.0130.00317.83
8.0.10.0080.00817.99

preferences:
33.24 ms | 403 KiB | 5 Q