3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tablier { public function __construct(public float $longueur, public float $largeur){ } } class Pont { private closure $taille = nullable; public function __sleep() { return array('name','tablier'); } public function __wakeup() { $this->taille = fn() => $this->tablier->longueur * $this->tablier->largeur; } public function __construct(protected string $name, protected Tablier $tablier) { $this->taille = fn() => $this->tablier->longueur * $this->tablier->largeur; } public function __clone(){ $this->tablier = clone $this->tablier; } } $pont1 = new Pont("towerBridge", new Tablier(386,16)); var_dump($pont1); $pont2 = clone $pont1; $chaine = serialise($pont1); echo $chaine; $pont3 = unserialise($chaine); var_dump($pont3);

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.1rc30.0040.00416.93
8.1rc20.0050.00517.00
8.1rc10.0030.00516.89
8.0.130.0030.00313.35
8.0.120.0000.00816.84
8.0.110.0080.00016.79
8.0.100.0000.00816.75
8.0.90.0050.00216.96
8.0.80.0030.00616.79
8.0.70.0000.00916.88
8.0.60.0000.00916.86
8.0.50.0030.00616.93
8.0.30.0030.00616.95
8.0.20.0040.00416.98
8.0.10.0080.00016.88
8.0.00.0000.00717.02
7.4.260.0000.00913.14
7.4.250.0000.00816.42
7.4.240.0000.00816.48
7.4.230.0080.00016.24
7.4.220.0040.00416.33
7.4.210.0000.00816.47
7.4.200.0040.00416.43
7.4.190.0000.00816.35
7.4.180.0040.00416.55
7.4.160.0040.00416.48
7.4.150.0030.00516.36
7.4.140.0000.00716.23
7.4.130.0050.00316.15
7.4.120.0000.00816.10
7.4.110.0040.00416.25
7.4.100.0000.00716.27
7.4.90.0000.00816.24
7.4.80.0080.00016.25
7.4.70.0030.00516.08
7.4.60.0080.00016.23
7.4.50.0050.00316.10
7.4.40.0040.00416.03
7.4.30.0000.00716.27
7.4.20.0000.00716.33
7.4.10.0080.00016.16
7.4.00.0030.00616.23
7.3.330.0000.00816.11
7.3.320.0000.00513.15
7.3.310.0000.00916.21
7.3.300.0070.00015.99
7.3.290.0030.00316.00
7.3.280.0040.00416.25
7.3.270.0020.00516.21
7.3.260.0000.00715.95
7.3.250.0040.00416.25
7.3.240.0000.00716.25
7.3.230.0000.00816.30
7.3.220.0050.00316.09
7.3.210.0030.00615.94
7.3.200.0040.00416.25
7.3.190.0050.00215.94
7.3.180.0030.00515.94
7.3.170.0050.00215.97
7.3.160.0040.00416.11
7.3.150.0050.00316.11
7.3.140.0030.00616.24
7.3.130.0040.00416.15
7.3.120.0040.00416.07
7.3.110.0030.00316.19
7.3.100.0030.00316.09
7.3.90.0000.00716.30
7.3.80.0000.00716.10
7.3.70.0070.00016.11
7.3.60.0000.00716.18
7.3.50.0000.00716.22
7.3.40.0000.00716.21
7.3.30.0070.00016.24
7.3.20.0070.00017.98
7.3.10.0000.00717.95
7.3.00.0040.00418.04

preferences:
23.31 ms | 527 KiB | 12 Q