3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tester { private $code = 0; static private $instance; private function __construct() { } static public function getInstance() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; } private $errors = array(); public function addError($txt, $code = 1) { $this->errors[] = ['txt' => $txt, 'code' => $code, 'tm' => date('Y-m-d H:i:s')]; if ($this->code === 0) { $this->code = $code; } } public function countErrors() { return count($this->errors); } public function valid() { return empty($this->errors) ? '0' : ($this->code != 0 ? $this->code : '999'); } public function showErrors() { return print_r($this->errors,1); } public function __toString() { return $this->showErrors(); } } $tester = Tester::getInstance(); $s = serialize($tester); $d = deserialize($s); var_dump($d);

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.60.0150.00016.75
8.3.50.0110.00722.04
8.3.40.0040.01118.93
8.3.30.0040.01118.92
8.3.20.0070.00020.13
8.3.10.0040.00423.70
8.3.00.0050.00319.69
8.2.180.0140.00718.79
8.2.170.0140.00022.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0030.00617.50
8.2.110.0060.00322.14
8.2.100.0060.00617.63
8.2.90.0040.00419.14
8.2.80.0050.00317.97
8.2.70.0030.00617.75
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0050.00219.38
8.2.30.0060.00319.83
8.2.20.0070.00017.75
8.2.10.0050.00218.09
8.2.00.0000.00818.14
8.1.280.0110.00725.92
8.1.270.0180.00020.38
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0070.00323.97
8.1.230.0000.01117.42
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0090.00017.36
8.1.180.0000.00818.10
8.1.170.0040.00418.43
8.1.160.0040.00422.03
8.1.150.0000.00818.91
8.1.140.0080.00017.48
8.1.130.0000.00717.73
8.1.120.0040.00417.48
8.1.110.0070.00017.44
8.1.100.0000.00817.56
8.1.90.0000.00717.51
8.1.80.0000.00717.40
8.1.70.0030.00317.49
8.1.60.0040.00417.65
8.1.50.0080.00017.50
8.1.40.0080.00017.47
8.1.30.0050.00317.62
8.1.20.0040.00417.53
8.1.10.0040.00417.56
8.1.00.0000.00817.55
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.49
8.0.270.0030.00317.22
8.0.260.0030.00717.31
8.0.250.0000.00817.07
8.0.240.0050.00217.04
8.0.230.0000.00717.07
8.0.220.0040.00417.01
8.0.210.0000.00817.00
8.0.200.0030.00317.00
8.0.190.0060.00316.98
8.0.180.0040.00416.88
8.0.170.0040.00416.95
8.0.160.0020.00516.91
8.0.150.0030.00416.82
8.0.140.0030.00616.95
8.0.130.0000.00613.39
8.0.120.0050.00316.87
8.0.110.0070.00016.80
8.0.100.0040.00416.83
8.0.90.0040.00417.04
8.0.80.0040.01116.96
8.0.70.0040.00416.82
8.0.60.0070.00017.04
8.0.50.0080.00016.87
8.0.30.0140.00817.00
8.0.20.0100.01217.40
8.0.10.0030.00516.90
8.0.00.0140.00516.88
7.4.330.0040.00415.08
7.4.320.0030.00316.52
7.4.300.0000.00716.63
7.4.290.0000.00716.61
7.4.280.0000.00716.50
7.4.270.0000.00716.61
7.4.260.0060.00616.50
7.4.250.0040.00416.61
7.4.240.0000.00716.47
7.4.230.0070.00016.65
7.4.220.0140.00416.73
7.4.210.0060.01316.62
7.4.200.0070.00016.47
7.4.160.0100.00616.48
7.4.150.0100.01017.40
7.4.140.0100.00717.86
7.4.130.0070.01016.55
7.4.120.0080.01516.64
7.4.110.0140.00716.50
7.4.100.0150.00616.47
7.4.90.0090.00916.50
7.4.80.0100.00719.39
7.4.70.0100.01416.57
7.4.60.0070.01616.60
7.4.50.0080.00016.69
7.4.40.0090.00816.28
7.4.30.0120.00616.60
7.4.00.0070.00715.06
7.3.330.0050.00013.40
7.3.320.0020.00213.35
7.3.310.0030.00316.36
7.3.300.0030.00316.35
7.3.290.0030.01316.38
7.3.280.0060.01416.31
7.3.270.0030.01417.40
7.3.260.0160.00316.44
7.3.250.0070.01216.43
7.3.240.0140.00716.56
7.3.230.0130.00316.39
7.3.210.0100.00616.31
7.3.200.0050.01616.49
7.3.190.0030.01416.64
7.3.180.0070.01416.40
7.3.170.0120.01216.58
7.3.160.0100.00716.31
7.3.10.0060.00616.53
7.3.00.0030.00616.65
7.2.330.0060.01116.74
7.2.320.0100.00716.52
7.2.310.0110.00716.70
7.2.300.0130.00916.64
7.2.290.0030.01316.66
7.2.130.0040.00716.81
7.2.120.0070.00416.81
7.2.110.0000.01416.71
7.2.100.0000.01316.70
7.2.90.0030.00716.73
7.2.80.0030.01016.63
7.2.70.0060.01016.81
7.2.60.0070.00816.88
7.2.50.0100.00316.86
7.2.40.0060.00616.99
7.2.30.0030.01016.78
7.2.20.0040.00816.73
7.2.10.0000.01116.79
7.2.00.0090.00618.15
7.1.250.0030.00915.88
7.1.200.0060.00615.76
7.1.100.0070.00718.12
7.1.70.0000.00716.96
7.1.60.0030.01719.27
7.1.50.0140.01116.86
7.1.00.0100.07022.40
7.0.200.0270.01014.61
7.0.90.0200.07019.96
7.0.80.0070.07019.97
7.0.70.0170.06719.98
7.0.60.0100.04019.99
7.0.50.0100.07720.31
7.0.40.0130.07320.05
7.0.30.0130.08720.09
7.0.20.0100.08320.06
7.0.10.0070.07720.18
7.0.00.0100.06320.12
5.6.280.0070.05721.14
5.6.240.0230.06720.61
5.6.230.0070.08320.65
5.6.220.0030.08720.48
5.6.210.0070.04020.57
5.6.200.0100.08321.10
5.6.190.0070.05721.05
5.6.180.0070.05021.03
5.6.170.0100.08020.96
5.6.160.0130.07721.07
5.6.150.0130.07721.11
5.6.140.0170.07021.09
5.6.130.0100.09021.04
5.6.120.0000.08721.02
5.6.110.0130.07321.03
5.6.100.0100.08720.91
5.6.90.0130.07021.00
5.6.80.0100.08320.41
5.6.70.0130.07320.45
5.6.60.0030.08720.40
5.6.50.0070.08320.44
5.6.40.0170.07020.45
5.6.30.0130.03720.33
5.6.20.0100.04720.41
5.6.10.0070.08320.53
5.6.00.0070.05020.31
5.5.380.0100.07720.55
5.5.370.0100.08320.42
5.5.360.0070.04720.45
5.5.350.0030.05020.40
5.5.340.0100.08020.88
5.5.330.0130.08720.81
5.5.320.0030.04720.77
5.5.310.0000.07020.89
5.5.300.0070.05720.90
5.5.290.0130.07720.93
5.5.280.0100.07720.84
5.5.270.0130.06320.65
5.5.260.0100.06320.88
5.5.250.0000.05020.60
5.5.240.0130.07320.23
5.5.230.0100.07720.20
5.5.220.0100.07320.25
5.5.210.0100.07020.29
5.5.200.0030.06020.12
5.5.190.0130.07320.00
5.5.180.0030.08720.23
5.5.160.0070.07320.16
5.5.150.0030.08720.18
5.5.140.0100.06720.07
5.5.130.0130.07320.28
5.5.120.0030.08320.29
5.5.110.0130.07320.27
5.5.100.0030.05320.09
5.5.90.0030.09020.17
5.5.80.0230.04020.08
5.5.70.0070.05320.07
5.5.60.0070.07320.09
5.5.50.0070.08020.14
5.5.40.0030.07719.95
5.5.30.0030.08320.00
5.5.20.0130.03720.05
5.5.10.0130.07320.10
5.5.00.0030.08319.96
5.4.450.0170.07319.41
5.4.440.0070.06719.50
5.4.430.0130.07319.43
5.4.420.0100.08019.50
5.4.410.0070.04719.15
5.4.400.0000.07318.95
5.4.390.0100.07718.85
5.4.380.0030.06719.18
5.4.370.0100.07018.84
5.4.360.0130.07318.87
5.4.350.0070.07719.14
5.4.340.0070.05718.90
5.4.320.0030.05319.12
5.4.310.0030.04319.21
5.4.300.0070.05018.87
5.4.290.0100.07018.85
5.4.280.0230.06319.12
5.4.270.0130.07018.87
5.4.260.0070.08319.20
5.4.250.0030.04319.12
5.4.240.0100.07019.11
5.4.230.0130.07319.13
5.4.220.0130.06718.89
5.4.210.0030.05719.20
5.4.200.0030.05019.04
5.4.190.0100.07319.02
5.4.180.0030.05719.17
5.4.170.0030.04719.13
5.4.160.0070.05719.06
5.4.150.0000.04319.18
5.4.140.0070.08316.46
5.4.130.0070.04316.40
5.4.120.0170.06016.40
5.4.110.0100.06016.50
5.4.100.0100.07316.27
5.4.90.0030.04716.39
5.4.80.0100.07716.41
5.4.70.0030.07716.27
5.4.60.0070.06016.45
5.4.50.0030.04016.36
5.4.40.0100.04016.51
5.4.30.0100.06716.25
5.4.20.0170.06316.29
5.4.10.0030.07716.44
5.4.00.0130.06015.90

preferences:
42.22 ms | 401 KiB | 5 Q