3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SimpleClass { const COSNTANT = "costant value"; private $var = "a default value"; function __construct($var) { $this->var = $var; } public function getVar() { return $this->var; } public function setVar($var) { $this->var = $var; } public function toString() { echo $this->var; } } $test = new SimpleClass("test2"); $test->setVar("test"); $test->toString(); //echo SimpleClass::CONSTANT; echo test::CONSTANT;

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.40.0140.00018.92
8.3.30.0090.00918.92
8.3.20.0040.00420.07
8.3.10.0040.00421.95
8.3.00.0040.00419.67
8.2.170.0060.01222.96
8.2.160.0070.00720.53
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0060.00317.38
8.2.110.0000.01021.11
8.2.100.0070.00417.84
8.2.90.0030.00517.89
8.2.80.0030.00517.97
8.2.70.0040.00417.75
8.2.60.0000.00918.03
8.2.50.0080.00018.07
8.2.40.0030.00519.46
8.2.30.0040.00419.85
8.2.20.0000.00717.61
8.2.10.0050.00218.03
8.2.00.0070.00018.09
8.1.270.0070.00020.41
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0030.00622.53
8.1.230.0070.00420.96
8.1.220.0030.00617.74
8.1.210.0050.00518.95
8.1.200.0030.00617.36
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00918.56
8.1.160.0040.00422.00
8.1.150.0060.00318.94
8.1.140.0040.00417.36
8.1.130.0050.00217.75
8.1.120.0000.00817.37
8.1.110.0000.00817.43
8.1.100.0040.00417.49
8.1.90.0040.00417.36
8.1.80.0000.00717.48
8.1.70.0000.00717.34
8.1.60.0040.00417.56
8.1.50.0040.00417.48
8.1.40.0050.00317.47
8.1.30.0000.00817.55
8.1.20.0000.00717.59
8.1.10.0000.00717.54
8.1.00.0050.00317.49
8.0.300.0000.00719.96
8.0.290.0040.00416.75
8.0.280.0030.00318.39
8.0.270.0000.00717.17
8.0.260.0000.00617.30
8.0.250.0040.00417.05
8.0.240.0050.00317.04
8.0.230.0000.00816.91
8.0.220.0000.00816.88
8.0.210.0070.00016.80
8.0.200.0000.00616.94
8.0.190.0040.00416.93
8.0.180.0070.00417.01
8.0.170.0040.00416.86
8.0.160.0040.00416.87
8.0.150.0000.00716.89
8.0.140.0000.00716.87
8.0.130.0030.00313.34
8.0.120.0040.00416.89
8.0.110.0050.00317.00
8.0.100.0040.00416.98
8.0.90.0000.00717.04
8.0.80.0070.01116.89
8.0.70.0070.00016.87
8.0.60.0000.00816.86
8.0.50.0070.00016.75
8.0.30.0140.00717.13
8.0.20.0110.01317.40
8.0.10.0000.00716.95
8.0.00.0080.01016.82
7.4.330.0050.00015.09
7.4.320.0030.00316.50
7.4.300.0030.00316.55
7.4.290.0000.00716.50
7.4.280.0080.00016.51
7.4.270.0030.00316.59
7.4.260.0040.00416.57
7.4.250.0000.00916.56
7.4.240.0020.00516.52
7.4.230.0000.00716.66
7.4.220.0060.01316.63
7.4.210.0050.01416.63
7.4.200.0040.00416.52
7.4.160.0160.00716.59
7.4.150.0100.00717.40
7.4.140.0090.01017.86
7.4.130.0110.00916.63
7.4.120.0060.01316.54
7.4.110.0170.00416.59
7.4.100.0090.00916.71
7.4.90.0060.01116.61
7.4.80.0100.00719.39
7.4.70.0090.01216.61
7.4.60.0080.01216.55
7.4.50.0030.00516.43
7.4.40.0130.00516.30
7.4.30.0110.00816.30
7.4.00.0000.01314.68
7.3.330.0060.00013.38
7.3.320.0050.00013.33
7.3.310.0030.00316.34
7.3.300.0000.00616.36
7.3.290.0070.00016.32
7.3.280.0070.01216.40
7.3.270.0170.00617.40
7.3.260.0170.00716.36
7.3.250.0080.00916.38
7.3.240.0120.00916.52
7.3.230.0070.01116.50
7.3.210.0110.00616.43
7.3.200.0110.00616.43
7.3.190.0000.01716.54
7.3.180.0090.00616.34
7.3.170.0090.00616.61
7.3.160.0100.01116.40
7.2.330.0130.01016.50
7.2.320.0070.01416.89
7.2.310.0030.01216.85
7.2.300.0070.01016.73
7.2.290.0090.01216.65
7.2.60.0030.01016.87
7.2.00.0000.01619.54
7.1.200.0090.00615.55
7.1.100.0060.00317.98
7.1.70.0000.00817.15
7.1.60.0060.01920.03
7.1.50.0130.01016.49
7.1.00.0100.07022.47
7.0.200.0000.00816.89
7.0.60.0100.08019.98
7.0.50.0070.08717.88
7.0.40.0130.08020.14
7.0.30.0400.06320.11
7.0.20.0300.06720.06
7.0.10.0070.04020.16
7.0.00.0130.04320.24
5.6.280.0000.03720.83
5.6.210.0100.06720.51
5.6.200.0030.09018.15
5.6.190.0030.07320.34
5.6.180.0330.04320.48
5.6.170.0170.04020.71
5.6.160.0130.07320.44
5.6.150.0100.05018.19
5.6.140.0130.07018.27
5.6.130.0030.08318.21
5.6.120.0100.08320.99
5.6.110.0100.05020.98
5.6.100.0100.06021.14
5.6.90.0100.07720.96
5.6.80.0070.08320.51
5.5.350.0330.07020.40
5.5.340.0070.07717.99
5.5.330.0100.06720.13
5.5.320.0230.03720.29
5.5.310.0300.06720.34
5.5.300.0100.03318.09
5.5.290.0070.05317.95
5.5.280.0100.04720.90
5.5.270.0030.05320.84
5.5.260.0030.08020.80
5.5.250.0100.05320.59
5.5.240.0070.02720.19
5.4.450.0300.06319.56
5.4.440.0370.05719.46
5.4.430.0330.05719.60
5.4.420.0400.04719.37
5.4.410.0400.04719.51
5.4.400.0370.05319.13
5.4.390.0400.05319.15
5.4.380.0370.05719.05
5.4.370.0300.06319.14
5.4.360.0300.06018.86
5.4.350.0400.04718.84
5.4.340.0370.05019.14
5.4.320.0400.05018.86
5.4.310.0370.05019.14
5.4.300.0270.06319.29
5.4.290.0330.05319.12
5.4.280.0300.06019.29
5.4.270.0300.05718.96
5.4.260.0470.04719.13
5.4.250.0400.05719.26
5.4.240.0500.04719.00
5.4.230.0430.05319.29
5.4.220.0430.05719.04
5.4.210.0530.04319.14
5.4.200.0370.05019.11
5.4.190.0400.04719.24
5.4.180.0300.05719.28
5.4.170.0500.04018.96
5.4.160.0430.05019.23
5.4.150.0370.06019.12
5.4.140.0500.04716.52
5.4.130.0300.05316.38
5.4.120.0370.05016.49
5.4.110.0400.05016.41
5.4.100.0370.05016.19
5.4.90.0470.05016.60
5.4.80.0400.04716.18
5.4.70.0270.07016.52
5.4.60.0230.06016.16
5.4.50.0170.03716.51
5.4.40.0270.05016.58
5.4.30.0000.07316.25
5.4.20.0200.03716.44
5.4.10.0330.05016.33

preferences:
50.05 ms | 400 KiB | 5 Q