3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorPrinter { /* ARRAY KEYS */ const KEY_NUMBER_OF_ERRORS = "number_of_errors"; const KEY_ERRORS = "errors"; /* ERROR CODES */ const ERROR_MISSING_PARAM = "10000"; //parameter missing from http post private $response = array(); private $errors = array(); private $number_of_errors = 0; function addError($error, $variable){ $this->errors[$variable] = $error; $this->number_of_errors = count($this->errors); } function printToJson(){ $response[$this->KEY_ERRORS] = $this->errors; $response[$this->KEY_NUMBER_OF_ERRORS] = $this->number_of_errors; return json_encode($this->response); } function getNumberOfErrors(){ return $this->number_of_errors; } } $printer = new ErrorPrinter; $printer->addError(ErrorPrinter::ERROR_MISSING_PARAM, 'name'); echo $printer->printToJson();

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.0140.00316.86
8.3.50.0080.01122.05
8.3.40.0110.00418.86
8.3.30.0070.01019.21
8.3.20.0050.00320.25
8.3.10.0040.00421.95
8.3.00.0070.00021.01
8.2.180.0130.00618.33
8.2.170.0070.00722.96
8.2.160.0090.00922.00
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00320.94
8.2.110.0060.00320.51
8.2.100.0110.00018.22
8.2.90.0000.00918.95
8.2.80.0030.00517.97
8.2.70.0050.00317.63
8.2.60.0070.00017.93
8.2.50.0060.00318.07
8.2.40.0000.00818.19
8.2.30.0040.00418.01
8.2.20.0000.00817.82
8.2.10.0060.00318.07
8.2.00.0000.00817.76
8.1.280.0170.00325.92
8.1.270.0000.00819.00
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0040.00422.13
8.1.230.0040.00719.00
8.1.220.0060.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0040.00418.62
8.1.160.0040.00421.98
8.1.150.0050.00318.91
8.1.140.0020.00519.24
8.1.130.0050.00317.84
8.1.120.0030.00517.35
8.1.110.0000.00817.52
8.1.100.0040.00417.45
8.1.90.0080.00017.47
8.1.80.0040.00417.36
8.1.70.0070.00017.46
8.1.60.0000.00817.59
8.1.50.0030.00517.55
8.1.40.0030.00517.54
8.1.30.0030.00617.69
8.1.20.0040.00417.46
8.1.10.0040.00417.43
8.1.00.0000.01317.49
8.0.300.0080.00018.77
8.0.290.0000.00716.75
8.0.280.0070.00018.45
8.0.270.0000.00817.27
8.0.260.0000.00617.33
8.0.250.0000.00717.07
8.0.240.0040.00417.05
8.0.230.0000.00816.86
8.0.220.0070.00016.88
8.0.210.0000.00716.91
8.0.200.0030.00316.93
8.0.190.0000.00816.86
8.0.180.0000.00717.03
8.0.170.0040.00417.00
8.0.160.0040.00417.01
8.0.150.0070.00017.02
8.0.140.0040.00416.86
8.0.130.0030.00313.30
8.0.120.0030.00516.96
8.0.110.0000.00716.79
8.0.100.0040.00416.94
8.0.90.0040.00416.93
8.0.80.0100.00716.97
8.0.70.0030.00517.09
8.0.60.0000.00816.92
8.0.50.0040.00416.77
8.0.30.0090.01417.11
8.0.20.0090.01117.40
8.0.10.0040.00417.07
8.0.00.0110.00616.88
7.4.330.0050.00015.08
7.4.320.0000.00616.53
7.4.300.0030.00616.62
7.4.290.0070.00016.50
7.4.280.0000.00816.52
7.4.270.0000.00716.53
7.4.260.0110.00016.53
7.4.250.0040.00416.40
7.4.240.0040.00416.51
7.4.230.0000.00716.41
7.4.220.0140.00816.50
7.4.210.0070.00716.57
7.4.200.0000.00716.72
7.4.160.0030.01316.54
7.4.150.0180.00617.40
7.4.140.0120.00617.86
7.4.130.0110.00816.54
7.4.120.0070.01016.60
7.4.110.0080.01116.48
7.4.100.0110.00816.62
7.4.90.0130.00416.66
7.4.80.0120.00616.57
7.4.70.0030.01316.58
7.4.60.0070.00716.56
7.4.50.0000.00816.60
7.4.40.0120.00916.55
7.4.30.0160.00716.55
7.4.00.0000.01714.95
7.3.330.0060.00013.43
7.3.320.0120.00013.37
7.3.310.0060.00016.41
7.3.300.0030.00316.41
7.3.290.0090.00816.43
7.3.280.0050.01316.43
7.3.270.0070.01117.40
7.3.260.0070.01616.57
7.3.250.0100.00916.46
7.3.240.0170.00716.53
7.3.230.0080.00916.58
7.3.210.0000.02116.38
7.3.200.0060.00919.39
7.3.190.0060.01016.65
7.3.180.0040.01116.66
7.3.170.0060.01316.55
7.3.160.0070.01416.53
7.3.10.0000.01316.73
7.3.00.0070.00716.68
7.2.330.0090.00916.46
7.2.320.0040.01316.57
7.2.310.0040.01516.49
7.2.300.0090.00916.77
7.2.290.0130.01016.77
7.2.130.0080.00516.97
7.2.120.0060.00816.87
7.2.110.0060.00616.85
7.2.100.0080.00616.85
7.2.90.0060.00716.85
7.2.80.0070.00817.13
7.2.70.0040.00616.95
7.2.60.0030.01016.79
7.2.50.0110.00316.79
7.2.40.0020.01217.00
7.2.30.0030.01016.62
7.2.20.0070.00716.87
7.2.10.0120.00116.81
7.2.00.0130.00517.67
7.1.250.0030.00915.49
7.1.240.0000.01715.70
7.1.230.0040.00715.66
7.1.220.0080.00415.75
7.1.210.0060.00315.59
7.1.200.0050.01015.77
7.1.190.0030.00715.86
7.1.180.0060.00615.68
7.1.170.0060.00315.63
7.1.160.0060.00315.63
7.1.150.0030.00615.90
7.1.140.0030.01015.62
7.1.130.0070.00415.83
7.1.120.0050.00315.87
7.1.110.0030.00715.64
7.1.100.0030.00916.84
7.1.90.0040.00815.68
7.1.80.0070.00315.60
7.1.70.0030.00616.58
7.1.60.0100.00717.64
7.1.50.0070.01116.42
7.1.40.0030.00815.56
7.1.30.0070.00715.66
7.1.20.0040.00715.78
7.1.10.0030.01215.85
7.1.00.0000.04519.09
7.0.330.0070.00315.46
7.0.320.0060.00615.39
7.0.310.0040.01115.43
7.0.300.0040.01115.25
7.0.290.0000.01415.39
7.0.280.0110.00415.49
7.0.270.0000.01515.39
7.0.260.0030.01015.47
7.0.250.0090.00415.36
7.0.240.0030.00915.27
7.0.230.0070.00715.19
7.0.220.0060.00615.44
7.0.210.0030.01015.17
7.0.200.0060.00415.93
7.0.190.0000.01115.45
7.0.180.0070.00315.40
7.0.170.0080.00315.57
7.0.160.0000.00915.45
7.0.150.0000.01115.35
7.0.140.0010.02318.64
7.0.130.0070.00315.29
7.0.120.0110.00415.35
7.0.110.0040.00415.52
7.0.100.0000.01015.51
7.0.90.0410.04217.58
7.0.80.0300.04117.53
7.0.70.0350.03817.74
7.0.60.0270.02917.73
7.0.50.0260.03217.92
7.0.40.0070.03316.88
7.0.30.0100.04116.80
7.0.20.0040.03616.87
7.0.10.0110.03716.70
7.0.00.0050.04416.79
5.6.380.0110.00014.54
5.6.370.0080.00814.60
5.6.360.0110.00414.38
5.6.350.0100.00614.40
5.6.340.0070.00714.36
5.6.330.0000.00914.30
5.6.320.0060.00314.65
5.6.310.0030.00814.61
5.6.300.0030.00614.48
5.6.290.0070.00714.71
5.6.280.0060.03817.68
5.6.270.0070.00314.23
5.6.260.0040.00714.42
5.6.250.0060.00614.43
5.6.240.0100.03917.73
5.6.230.0060.02817.50
5.6.220.0090.03917.42
5.6.210.0130.03217.31
5.6.200.0110.04117.69
5.6.190.0030.04717.82
5.6.180.0050.04417.95
5.6.170.0100.04117.67
5.6.160.0130.02717.89
5.6.150.0050.03017.78
5.6.140.0080.04517.63
5.6.130.0120.04017.90
5.6.120.0100.04217.68
5.6.110.0030.04717.81
5.6.100.0050.04217.69
5.6.90.0060.02617.64
5.6.80.0010.03917.36
5.6.70.0120.03317.29
5.6.60.0070.03917.28
5.6.50.0100.03717.35
5.6.40.0030.04317.31
5.6.30.0070.03517.45
5.6.20.0060.04017.40
5.6.10.0120.04017.38
5.6.00.0100.03517.38
5.5.380.0040.04115.92
5.5.370.0100.03615.92
5.5.360.0060.02516.03
5.5.350.0070.04416.03
5.5.340.0080.03816.14
5.5.330.0040.04116.07
5.5.320.0100.03515.90
5.5.310.0080.03716.01
5.5.300.0040.04316.04
5.5.290.0030.04116.05
5.5.280.0110.03515.94
5.5.270.0050.04316.21
5.5.260.0150.03715.92
5.5.250.0080.02316.01
5.5.240.0070.02515.79
5.5.230.0050.04415.56
5.5.220.0060.03015.61
5.5.210.0080.04015.81
5.5.200.0080.02715.74
5.5.190.0100.03815.71
5.5.180.0020.03115.67
5.5.170.0060.00311.04
5.5.160.0020.03015.63
5.5.150.0080.03715.58
5.5.140.0070.04215.66
5.5.130.0080.03815.60
5.5.120.0050.04415.82
5.5.110.0100.04015.65
5.5.100.0030.04115.67
5.5.90.0050.04015.62
5.5.80.0050.02815.65
5.5.70.0050.02715.58
5.5.60.0030.02615.62
5.5.50.0000.02815.53
5.5.40.0050.03915.64
5.5.30.0100.04015.74
5.5.20.0050.04215.64
5.5.10.0080.04015.57
5.5.00.0070.04015.56
5.4.450.0080.04315.33
5.4.440.0080.04115.38
5.4.430.0040.03215.25
5.4.420.0050.03515.53
5.4.410.0050.04115.20
5.4.400.0060.03515.23
5.4.390.0050.02715.11
5.4.380.0080.03015.15
5.4.370.0060.03915.06
5.4.360.0020.04515.04
5.4.350.0020.04614.94
5.4.340.0060.04015.05
5.4.330.0080.00311.18
5.4.320.0070.02714.96
5.4.310.0070.03415.11
5.4.300.0060.03615.23
5.4.290.0020.04615.01
5.4.280.0030.04515.11
5.4.270.0050.04215.00
5.4.260.0050.02314.92
5.4.250.0040.03215.08
5.4.240.0000.04915.08
5.4.230.0040.03915.04
5.4.220.0000.03015.03
5.4.210.0020.02715.16
5.4.200.0050.04215.14
5.4.190.0060.03915.13
5.4.180.0050.03314.97
5.4.170.0050.02615.15
5.4.160.0030.04115.05
5.4.150.0070.04015.00
5.4.140.0030.04113.81
5.4.130.0050.03813.74
5.4.120.0050.03313.88
5.4.110.0020.04213.83
5.4.100.0050.02213.77
5.4.90.0070.03913.78
5.4.80.0040.03613.71
5.4.70.0090.02013.81
5.4.60.0020.04113.56
5.4.50.0060.03513.84
5.4.40.0050.03013.88
5.4.30.0060.03213.73
5.4.20.0080.03313.87
5.4.10.0070.03513.69
5.4.00.0020.04213.42
5.3.290.0030.02412.62
5.3.280.0030.03112.62
5.3.270.0050.03512.63
5.3.260.0140.01912.63
5.3.250.0030.03512.72
5.3.240.0100.03312.63
5.3.230.0080.03812.53
5.3.220.0050.03812.58
5.3.210.0050.02712.56
5.3.200.0050.03712.65
5.3.190.0170.02812.60
5.3.180.0060.04012.65
5.3.170.0030.03512.67
5.3.160.0030.04412.63
5.3.150.0020.04412.76
5.3.140.0070.04012.63
5.3.130.0050.03012.56
5.3.120.0050.02512.72
5.3.110.0100.03812.65
5.3.100.0080.03912.37
5.3.90.0030.03812.42
5.3.80.0070.03912.17
5.3.70.0050.04012.31
5.3.60.0030.03812.30
5.3.50.0120.02912.23
5.3.40.0030.03112.18
5.3.30.0030.04012.24
5.3.20.0050.03211.94
5.3.10.0050.03611.98
5.3.00.0030.03412.07
5.2.170.0020.03310.59
5.2.160.0000.02810.52
5.2.150.0010.03610.56
5.2.140.0010.03610.58
5.2.130.0080.02810.59
5.2.120.0050.02810.58
5.2.110.0030.03110.54
5.2.100.0100.02310.55
5.2.90.0050.02810.49
5.2.80.0030.02310.59
5.2.70.0080.02610.46
5.2.60.0030.03410.44
5.2.50.0060.02210.45
5.2.40.0060.01810.50
5.2.30.0020.03110.51
5.2.20.0030.03310.39
5.2.10.0020.02310.45
5.2.00.0030.03010.37
5.1.60.0030.0299.98
5.1.50.0050.02010.00
5.1.40.0030.02910.01
5.1.30.0030.02910.22
5.1.20.0040.02810.17
5.1.10.0030.0229.94
5.1.00.0010.02910.02
5.0.50.0030.0159.29
5.0.40.0060.0189.22
5.0.30.0030.0279.04
5.0.20.0020.0249.08
5.0.10.0030.0249.12
5.0.00.0010.0349.06
4.4.90.0020.0178.63
4.4.80.0050.0158.63
4.4.70.0020.0188.63
4.4.60.0010.0208.63
4.4.50.0040.0128.63
4.4.40.0050.0238.63
4.4.30.0050.0098.63
4.4.20.0080.0138.63
4.4.10.0000.0188.63
4.4.00.0020.0178.63
4.3.110.0020.0198.63
4.3.100.0000.0148.63
4.3.90.0060.0158.63
4.3.80.0030.0198.63
4.3.70.0030.0188.63
4.3.60.0000.0208.63
4.3.50.0000.0218.63
4.3.40.0020.0228.63
4.3.30.0020.0128.63
4.3.20.0010.0228.63
4.3.10.0020.0188.63
4.3.00.0000.0198.63

preferences:
50.92 ms | 401 KiB | 5 Q