3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CustomException extends Exception { public $object; public $wantedValue; public $changedValue; public function __construct( string $msg, SomeClass $object, int $wantedValue, int $changedValue ) { parent::__construct($msg); $this->object = $object; $this->wantedValue = $wantedValue; $this->changedValue = $changedValue; } } class SomeClass { private $value; public function __construct(int $value) { $this->value = $value; if($value > 10) { throw new CustomException( sprintf("Value %d is larger than the max 10 setting to 10!", $value), $this, $value, $this->value = 10 ); } } } $valid = new SomeClass(9); var_dump($valid); try { $invalid = new SomeClass(20); } catch (CustomException $e) { echo PHP_EOL, $e->getMessage(), PHP_EOL, PHP_EOL; $invalid = $e->object; // I can still access the invalid object var_dump($invalid); }

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.130.0070.00718.65
8.3.120.0150.00018.86
8.3.110.0030.01216.62
8.3.100.0070.00418.68
8.3.90.0090.00026.77
8.3.80.0000.00919.36
8.3.70.0120.00616.63
8.3.60.0040.01116.72
8.3.50.0120.00823.55
8.3.40.0090.01222.00
8.3.30.0080.00818.96
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0050.00226.16
8.2.250.0030.00717.08
8.2.240.0040.00416.68
8.2.230.0060.00320.94
8.2.220.0060.00324.06
8.2.210.0090.00026.77
8.2.200.0060.00318.54
8.2.190.0150.00716.58
8.2.180.0120.00325.92
8.2.170.0040.01419.20
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0070.00026.35
8.2.110.0070.00320.87
8.2.100.0070.00417.84
8.2.90.0000.00819.33
8.2.80.0000.00818.22
8.2.70.0040.00417.63
8.2.60.0000.00817.63
8.2.50.0060.00618.05
8.2.40.0000.00818.09
8.2.30.0040.00418.18
8.2.20.0040.00418.16
8.2.10.0000.00719.31
8.2.00.0000.00819.36
8.1.300.0080.00017.77
8.1.290.0060.00318.88
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0030.00628.09
8.1.250.0040.00428.09
8.1.240.0000.00922.46
8.1.230.0040.00822.66
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0050.00317.48
8.1.190.0000.00819.01
8.1.180.0030.00718.10
8.1.170.0060.00318.24
8.1.160.0040.00418.86
8.1.150.0000.00718.88
8.1.140.0040.00419.00
8.1.130.0000.00720.27
8.1.120.0030.00517.49
8.1.110.0040.00417.45
8.1.100.0000.00917.48
8.1.90.0040.00417.52
8.1.80.0030.00617.47
8.1.70.0000.01017.48
8.1.60.0030.00617.61
8.1.50.0000.00817.52
8.1.40.0030.00617.55
8.1.30.0040.00417.56
8.1.20.0080.00017.59
8.1.10.0030.00517.48
8.1.00.0040.00417.51
8.0.300.0070.00019.93
8.0.290.0040.00416.75
8.0.280.0020.00518.31
8.0.270.0000.00717.98
8.0.260.0030.00320.27
8.0.250.0000.00716.94
8.0.240.0030.00317.08
8.0.230.0000.00716.92
8.0.220.0030.00316.91
8.0.210.0000.00716.84
8.0.200.0000.00716.99
8.0.190.0040.00416.95
8.0.180.0040.00416.96
8.0.170.0040.00416.88
8.0.160.0080.00416.89
8.0.150.0040.00416.95
8.0.140.0040.00416.82
8.0.130.0000.00513.32
8.0.120.0000.00816.86
8.0.110.0000.00816.74
8.0.100.0000.00717.00
8.0.90.0000.00716.81
8.0.80.0100.01116.89
8.0.70.0030.00516.76
8.0.60.0000.00716.86
8.0.50.0040.00416.90
8.0.30.0060.01317.28
8.0.20.0100.00917.20
8.0.10.0020.00516.99
8.0.00.0110.00816.86
7.4.330.0030.00316.79
7.4.320.0030.00316.49
7.4.300.0000.00716.50
7.4.290.0040.00416.55
7.4.280.0040.00416.62
7.4.270.0000.00716.51
7.4.260.0030.00313.30
7.4.250.0000.00816.48
7.4.240.0000.00716.48
7.4.230.0040.00416.59
7.4.220.0050.00216.53
7.4.210.0070.00916.52
7.4.200.0040.00416.57
7.4.130.0070.01316.64
7.4.120.0190.00016.55
7.4.110.0140.00316.66
7.4.100.0120.00616.52
7.4.90.0110.00716.25
7.4.80.0110.00716.52
7.4.70.0100.00716.16
7.4.60.0130.00316.29
7.4.50.0130.00316.58
7.4.40.0080.00816.68
7.4.30.0170.00016.38
7.4.20.0090.00816.67
7.4.10.0130.00316.51
7.4.00.0160.00616.75
7.3.330.0000.00716.43
7.3.320.0050.00313.33
7.3.310.0030.00316.43
7.3.300.0030.00316.39
7.3.290.0070.00916.41
7.3.260.0100.00716.47
7.3.230.0100.00716.54
7.3.220.0060.01016.58
7.3.210.0080.00816.55
7.3.200.0110.00716.36
7.3.190.0060.01216.29
7.3.180.0100.00716.47
7.3.170.0060.01116.44
7.3.160.0030.01416.57
7.3.150.0040.01316.68
7.3.140.0120.01216.58
7.3.130.0100.01316.62
7.3.120.0130.01016.50
7.3.110.0030.01516.25
7.3.100.0060.01216.67
7.3.90.0140.00916.61
7.3.80.0200.00616.33
7.3.70.0100.01816.27
7.3.60.0140.01016.39
7.3.50.0100.01416.55
7.3.40.0180.00716.41
7.3.30.0160.00716.39
7.3.20.0090.01216.63
7.3.10.0070.01116.38
7.3.00.0030.01616.34
7.2.340.0070.01016.79
7.2.330.0030.01316.78
7.2.320.0080.00816.42
7.2.310.0070.01016.79
7.2.300.0070.01016.76
7.2.290.0090.00916.62
7.2.280.0070.01016.52
7.2.270.0120.00616.66
7.2.260.0070.01716.88
7.2.250.0200.00616.59
7.2.240.0100.01316.49
7.2.230.0030.01716.89
7.2.220.0180.00416.59
7.2.210.0170.00716.67
7.2.200.0060.01716.53
7.2.190.0090.01516.64
7.2.180.0100.01416.50
7.2.170.0070.01416.50
7.2.160.0140.00616.40
7.2.150.0170.00916.71
7.2.140.0130.00616.69
7.2.130.0030.01616.87
7.2.120.0100.01016.76
7.2.110.0720.00616.67
7.2.100.0080.01316.65
7.2.90.0130.01016.79
7.2.80.0130.00616.66
7.2.70.0230.00016.59
7.2.60.0120.01316.58
7.2.50.0120.00916.74
7.2.40.0060.01616.65
7.2.30.0030.01716.61
7.2.20.0150.00616.75
7.2.10.0120.00916.65
7.2.00.0090.01516.79

preferences:
26.7 ms | 403 KiB | 5 Q