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 = null; 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.0.110.0000.00716.70
8.0.100.0070.00016.82
8.0.90.0050.00216.81
8.0.80.0000.00716.88
8.0.70.0000.00816.81
8.0.60.0000.00816.68
8.0.50.0000.00816.81
8.0.30.0050.00516.75
8.0.20.0040.00416.95
8.0.10.0040.00416.83
8.0.00.0040.00416.95
7.4.240.0030.00316.45
7.4.230.0040.00416.46
7.4.220.0000.00716.32
7.4.210.0070.00016.25
7.4.200.0000.00716.43
7.4.190.0000.00716.43
7.4.180.0070.00016.53
7.4.160.0000.00716.51
7.4.150.0070.00016.29
7.4.140.0000.00716.24
7.4.130.0070.00016.23
7.4.120.0000.00716.22
7.4.110.0030.00316.26
7.4.100.0000.00716.38
7.4.90.0000.00816.09
7.4.80.0030.00316.34
7.4.70.0040.00416.25
7.4.60.0000.00716.24
7.4.50.0080.00016.28
7.4.40.0030.00316.11
7.4.30.0000.00716.07
7.4.20.0030.00516.28
7.4.10.0000.00816.28
7.4.00.0000.00816.35
7.3.310.0000.00715.99
7.3.300.0030.00316.21
7.3.290.0030.00316.21
7.3.280.0070.00016.31
7.3.270.0030.00316.25
7.3.260.0070.00016.14
7.3.250.0040.00416.17
7.3.240.0000.00816.13
7.3.230.0000.00716.13
7.3.220.0030.00316.13
7.3.210.0000.00716.19
7.3.200.0030.00316.14
7.3.190.0060.00016.03
7.3.180.0060.00015.95
7.3.170.0070.00015.96
7.3.160.0070.00015.96
7.3.150.0070.00016.19
7.3.140.0060.00016.07
7.3.130.0040.00416.11
7.3.120.0030.00316.04
7.3.110.0030.00316.09
7.3.100.0000.00716.00
7.3.90.0040.00416.22
7.3.80.0000.00716.12
7.3.70.0040.00415.99
7.3.60.0050.00216.08
7.3.50.0030.00516.29
7.3.40.0040.00416.28
7.3.30.0000.00716.14
7.3.20.0000.00718.11
7.3.10.0030.00317.94
7.3.00.0040.00417.82

preferences:
144.71 ms | 1386 KiB | 7 Q