3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Pont { private const SURFACE_TEXT = 'Ce pont mesure %dm'; private float $longueur; private float $largeur; public function setLongueur(float $longueur): void { if ($longueur < 0) { trigger_error( 'La longueur est trop courte. (min 1)', E_USER_ERROR ); } $this->longueur = $longueur; } public function getLongueur(): float { return $this->longueur; } public function setLargeur(float $largeur): void { if ($largeur < 0) { trigger_error( 'La largeur est trop courte. (min 1)', E_USER_ERROR ); } $this->largeur = $largeur; } public function getLargeur(): float { return $this->largeur; } public function getSurface(): float { return $this->longueur * $this->largeur; } public function printSurface(): void { echo sprintf(self::SURFACE_TEXT, $this->getSurface()); } } $towerBridge = new Pont; $towerBridge->setLongueur(286.0); $towerBridge->setLargeur(15.0); $towerBridge->printSurface();

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.0100.01017.77
8.4.10.0140.00317.95
8.3.150.0120.00616.55
8.3.140.0060.00318.80
8.3.130.0040.00418.46
8.3.120.0190.00417.93
8.3.110.0170.00818.07
8.3.100.0260.00216.56
8.3.90.0220.00319.76
8.3.80.0240.00622.53
8.3.70.0240.00517.26
8.3.60.0300.01018.62
8.3.50.0180.00619.11
8.3.40.0210.00919.57
8.3.30.0230.00719.52
8.3.20.0250.00421.41
8.3.10.0180.00621.49
8.3.00.0140.00822.69
8.2.260.0120.00616.74
8.2.250.0060.00316.83
8.2.240.0120.00616.66
8.2.230.0220.00418.51
8.2.220.0150.00918.93
8.2.210.0170.00719.78
8.2.200.0180.00316.52
8.2.190.0170.00516.99
8.2.180.0260.00620.54
8.2.170.0310.00519.68
8.2.160.0250.00820.38
8.2.150.0200.01021.73
8.2.140.0210.00521.49
8.2.130.0190.00422.67
8.2.120.0210.00421.72
8.2.110.0170.00621.99
8.2.100.0190.00620.21
8.2.90.0180.00620.19
8.2.80.0190.00620.36
8.2.70.0180.00634.90
8.2.60.0180.00627.99
8.2.50.0200.00527.83
8.2.40.0160.00626.96
8.2.30.0170.00727.95
8.2.20.0170.00527.82
8.2.10.0150.00625.93
8.2.00.0160.00526.40
8.1.310.0000.00816.11
8.1.300.0210.01016.79
8.1.290.0190.01220.85
8.1.280.0270.00520.42
8.1.270.0220.00521.44
8.1.260.0150.00922.64
8.1.250.0190.00622.93
8.1.240.0160.00721.59
8.1.230.0160.00620.88
8.1.220.0200.00720.25
8.1.210.0220.00520.24
8.1.200.0180.00528.47
8.1.190.0140.00727.68
8.1.180.0180.00727.70
8.1.170.0150.00627.79
8.1.160.0170.00527.78
8.1.150.0160.00627.77
8.1.140.0160.00727.15
8.1.130.0160.00526.29
8.1.120.0140.00625.30
8.1.110.0150.00525.31
8.1.100.0150.00625.25
8.1.90.0130.00523.68
8.1.80.0130.00623.17
8.1.70.0130.00622.98
8.1.60.0150.00522.98
8.1.50.0130.00623.12
8.1.40.0150.00623.10
8.1.30.0140.00722.87
8.1.20.0160.00422.05
8.1.10.0170.00622.41
8.1.00.0170.00522.37
8.0.300.0220.00520.16
8.0.290.0190.00428.18
8.0.280.0190.00527.52
8.0.270.0150.00725.91
8.0.260.0170.00525.85
8.0.250.0150.00524.94
8.0.240.0160.00524.96
8.0.230.0150.00625.01
8.0.220.0170.00524.87
8.0.210.0150.00523.81
8.0.200.0140.00523.11
8.0.190.0130.00622.82
8.0.180.0130.00622.63
8.0.170.0140.00622.60
8.0.160.0150.00422.60
8.0.150.0140.00521.99
8.0.140.0140.00621.83
8.0.130.0140.00521.22
8.0.120.0140.00621.21
8.0.110.0150.00420.98
8.0.100.0120.00520.46
8.0.90.0120.00520.65
8.0.80.0140.00420.75
8.0.70.0140.00420.86
8.0.60.0130.00420.85
8.0.50.0140.00420.86
8.0.30.0120.00620.77
8.0.20.0120.00620.90
8.0.10.0130.00520.96
8.0.00.0100.00621.00
7.4.330.0140.00324.77
7.4.320.0160.00524.75
7.4.300.0140.00522.64
7.4.290.0130.00622.43
7.4.280.0140.00522.42
7.4.270.0150.00521.68
7.4.260.0140.00621.26
7.4.250.0150.00520.61
7.4.240.0130.00520.79
7.4.230.0140.00520.70
7.4.220.0120.00420.58
7.4.210.0110.00520.48
7.4.200.0110.00520.69
7.4.190.0120.00520.85
7.4.180.0120.00520.86
7.4.160.0130.00420.73
7.4.150.0130.00420.69
7.4.140.0130.00520.64
7.4.130.0120.00520.65
7.4.120.0130.00420.65
7.4.110.0120.00620.65
7.4.100.0120.00620.70
7.4.90.0120.00520.64
7.4.80.0130.00420.62
7.4.70.0120.00520.65
7.4.60.0120.00520.62
7.4.50.0120.00520.56
7.4.40.0120.00520.57
7.4.30.0120.00520.62
7.4.20.0110.00520.62
7.4.10.0120.00520.62
7.4.00.0120.00520.61
7.3.330.0150.00421.23
7.3.320.0150.00521.08
7.3.310.0130.00520.68
7.3.300.0140.00420.45
7.3.290.0130.00520.22
7.3.280.0140.00520.56
7.3.270.0130.00420.46
7.3.260.0130.00420.44
7.3.250.0130.00520.47
7.3.240.0130.00420.44
7.3.230.0130.00420.45
7.3.220.0130.00420.35
7.3.210.0130.00520.38
7.3.200.0140.00420.38
7.3.190.0130.00520.44
7.3.180.0140.00420.41
7.3.170.0130.00420.40
7.3.160.0130.00420.40
7.3.150.0130.00520.38
7.3.140.0140.00420.40
7.3.130.0130.00420.41
7.3.120.0120.00520.41
7.3.110.0120.00520.36
7.3.100.0130.00420.37
7.3.90.0140.00420.59
7.3.80.0120.00520.40
7.3.70.0120.00520.40
7.3.60.0120.00520.47
7.3.50.0130.00420.46
7.3.40.0120.00420.48
7.3.30.0120.00520.46
7.3.20.0140.00521.20
7.3.10.0120.00521.15
7.3.00.0140.00521.16

preferences:
34.49 ms | 403 KiB | 5 Q