3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ColorChanger { public $lastColor; public function blackMethod() { echo "blackMethod(); Last color: {$this->lastColor}\n"; $this->lastColor = 'black'; return $this; } public function whiteMethod() { echo "whiteMethod(); Last color: {$this->lastColor}\n"; $this->lastColor = 'white'; return $this; } public function colourMethod() { echo "colourMethod(): {$this->lastColor}\n"; $this->lastColor = null; } } $c = new ColorChanger(); $c->blackMethod()->colourMethod(); $c->whiteMethod()->colourMethod(); $c->blackMethod()->whiteMethod()->colourMethod();

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.5.10.0120.00516.59
8.5.00.0180.00819.98
8.4.150.0030.00014.05
8.4.140.0150.00717.48
8.4.130.0150.00518.88
8.4.120.0130.00720.46
8.4.110.0140.00818.77
8.4.100.0120.00818.86
8.4.90.0140.00620.62
8.4.80.0060.00319.53
8.4.70.0100.01117.90
8.4.60.0150.00618.98
8.4.50.0060.00318.80
8.4.40.0090.00919.66
8.4.30.0070.01317.63
8.4.20.0140.00719.44
8.4.10.0040.00418.63
8.3.280.0110.00818.39
8.3.270.0120.00916.65
8.3.260.0090.01216.70
8.3.250.0090.00918.91
8.3.240.0140.00516.52
8.3.230.0110.01016.73
8.3.220.0150.00418.68
8.3.210.0090.00518.61
8.3.200.0060.00316.66
8.3.190.0100.00617.22
8.3.180.0120.00716.71
8.3.170.0100.01019.16
8.3.160.0080.00018.47
8.3.150.0120.00916.64
8.3.140.0040.00419.05
8.3.130.0060.00318.52
8.3.120.0090.00920.71
8.3.110.0090.00020.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0040.00418.56
8.3.70.0070.01418.05
8.3.60.0110.00718.09
8.3.50.0080.00917.42
8.3.40.0070.00718.76
8.3.30.0130.00318.59
8.3.20.0080.00019.19
8.3.10.0040.00423.48
8.3.00.0040.00423.28
8.2.290.0140.00520.53
8.2.280.0090.01018.73
8.2.270.0070.01019.00
8.2.260.0030.00516.49
8.2.250.0080.00018.31
8.2.240.0120.00618.91
8.2.230.0080.00422.58
8.2.220.0120.00337.54
8.2.210.0040.00426.77
8.2.200.0060.00316.50
8.2.190.0000.01616.88
8.2.180.0150.00616.38
8.2.170.0110.00422.96
8.2.160.0120.00318.99
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00420.30
8.2.120.0040.00426.16
8.2.110.0030.00719.39
8.2.100.0110.00019.58
8.2.90.0050.00317.63
8.2.80.0030.00517.97
8.2.70.0090.00017.78
8.2.60.0040.00418.04
8.2.50.0050.00318.10
8.2.40.0080.00019.48
8.2.30.0040.00419.16
8.2.20.0070.00318.06
8.2.10.0040.00419.35
8.2.00.0050.00519.41
8.1.330.0110.00816.14
8.1.320.0110.00916.43
8.1.310.0000.00818.45
8.1.300.0060.00316.35
8.1.290.0100.00030.84
8.1.280.0130.00925.92
8.1.270.0040.00423.99
8.1.260.0060.00926.35
8.1.250.0000.00828.09
8.1.240.0100.00021.23
8.1.230.0090.00319.08
8.1.220.0060.00317.76
8.1.210.0000.00818.77
8.1.200.0030.00617.25
8.1.190.0060.00317.23
8.1.180.0000.00918.10
8.1.170.0070.00018.91
8.1.160.0000.00718.77
8.1.150.0070.00018.85
8.1.140.0000.00817.95
8.1.130.0030.00319.04
8.1.120.0030.00717.45
8.1.110.0000.00717.41
8.1.100.0030.00317.48
8.1.90.0000.00817.40
8.1.80.0000.00717.29
8.1.70.0000.00817.32
8.1.60.0000.00817.51
8.1.50.0030.00617.55
8.1.40.0090.00017.46
8.1.30.0040.00417.63
8.1.20.0040.00417.72
8.1.10.0000.00817.49
8.1.00.0100.00017.52
8.0.300.0070.00018.77
8.0.290.0080.00016.71
8.0.280.0070.00018.48
8.0.270.0070.00017.29
8.0.260.0030.00317.34
8.0.250.0080.00016.90
8.0.240.0000.00717.00
8.0.230.0030.00516.87
8.0.220.0070.00016.95
8.0.210.0070.00016.97
8.0.200.0000.00716.95
8.0.190.0070.00016.99
8.0.180.0030.00517.00
8.0.170.0030.00616.93
8.0.160.0040.00416.76
8.0.150.0070.00016.96
8.0.140.0000.00816.89
8.0.130.0030.00313.41
8.0.120.0070.00016.95
8.0.110.0050.00316.79
8.0.100.0000.00716.78
8.0.90.0050.00216.95
8.0.80.0150.00716.91
8.0.70.0040.00416.86
8.0.60.0000.00816.90
8.0.50.0050.00216.86
8.0.30.0090.01017.03
8.0.20.0150.00417.40
8.0.10.0070.00017.00
8.0.00.0050.01416.87
7.4.330.0030.00315.55
7.4.320.0030.00316.39
7.4.300.0040.00416.52
7.4.290.0030.00316.65
7.4.280.0040.00416.63
7.4.270.0070.00016.62
7.4.260.0070.00016.65
7.4.250.0030.00316.52
7.4.240.0050.00316.65
7.4.230.0050.00216.41
7.4.220.0000.00816.61
7.4.210.0110.00916.66
7.4.200.0040.00416.34
7.4.160.0090.00916.63
7.4.140.0140.00817.86
7.4.130.0070.01016.57
7.4.120.0110.00816.56
7.4.110.0030.01316.33
7.4.100.0090.00916.63
7.4.90.0110.00716.30
7.4.80.0100.00719.39
7.4.70.0170.00416.49
7.4.60.0100.00616.57
7.4.50.0000.01816.58
7.4.40.0170.00016.50
7.4.00.0090.00814.89
7.3.330.0020.00213.18
7.3.320.0060.00013.25
7.3.310.0070.00016.36
7.3.300.0030.00316.28
7.3.290.0000.00716.36
7.3.280.0100.00716.25
7.3.260.0100.00916.48
7.3.240.0110.01016.40
7.3.230.0140.00416.52
7.3.210.0140.00716.34
7.3.200.0060.01116.30
7.3.190.0070.01016.27
7.3.180.0070.01416.36
7.3.170.0100.01116.31
7.3.160.0100.00716.25
7.3.120.0030.01414.78
7.3.110.0040.01214.54
7.3.100.0130.00614.96
7.3.90.0130.00014.55
7.3.80.0030.01314.66
7.3.70.0060.00314.72
7.3.60.0030.00614.78
7.3.50.0040.00814.85
7.3.40.0000.01514.76
7.3.30.0030.00614.87
7.3.20.0040.00816.50
7.3.10.0040.01216.45
7.3.00.0070.00516.64
7.2.330.0090.00916.80
7.2.320.0100.00716.63
7.2.310.0130.00416.79
7.2.300.0060.01016.61
7.2.290.0060.01116.79
7.2.250.0140.00415.11
7.2.240.0060.00614.75
7.2.230.0040.01114.97
7.2.220.0110.00714.94
7.2.210.0080.00415.27
7.2.200.0030.00914.81
7.2.190.0070.01014.73
7.2.180.0030.01414.94
7.2.170.0030.01014.64
7.2.160.0030.00915.02
7.2.150.0080.00416.92
7.2.140.0070.00716.88
7.2.130.0090.00516.74
7.2.120.0010.00716.88
7.2.110.0070.00716.98
7.2.100.0100.00516.90
7.2.90.0030.00717.10
7.2.80.0330.00716.19
7.2.70.0380.00416.40
7.2.60.0280.01216.14
7.2.50.0250.00616.10
7.2.40.0390.00716.07
7.2.30.0310.00715.91
7.2.20.0220.00916.27
7.2.10.0230.00616.00
7.2.00.0310.00816.18
7.1.330.0110.00615.51
7.1.320.0100.00715.69
7.1.310.0000.00915.74
7.1.300.0110.00415.70
7.1.290.0030.01015.40
7.1.280.0040.00815.66
7.1.270.0030.01215.76
7.1.260.0030.00615.72
7.1.250.0030.00915.64
7.1.240.0100.00015.87
7.1.230.0000.01415.51
7.1.220.0040.01115.35
7.1.210.0060.00615.77
7.1.200.0030.00915.66
7.1.190.0450.01014.58
7.1.180.0430.00614.41
7.1.170.0460.00814.65
7.1.160.0440.01014.45
7.1.150.0470.00614.60
7.1.140.0290.00814.79
7.1.130.0290.00814.64
7.1.120.0400.01314.66
7.1.110.0440.00914.64
7.1.100.0420.00814.66
7.1.90.0860.00814.62
7.1.80.0820.00514.76
7.1.70.0760.00814.78
7.1.60.0730.01523.79
7.1.50.1010.01023.50
7.1.40.0900.01123.75
7.1.30.0620.01323.63
7.1.20.0640.00823.50
7.1.10.0860.01014.75
7.1.00.0620.00814.68
7.0.330.0060.00615.03
7.0.320.0040.00715.37
7.0.310.0000.01315.44
7.0.300.0070.00315.09
7.0.290.0050.00315.51
7.0.280.0070.01015.34
7.0.270.0030.00715.29
7.0.260.0040.01115.32
7.0.250.0030.01315.36
7.0.240.0030.00915.11
7.0.230.0030.01215.32
7.0.220.0080.00415.14
7.0.210.0040.01115.35
7.0.200.0000.01315.49
7.0.190.0070.00715.43
7.0.180.0080.00415.39
7.0.170.0000.01315.13
7.0.160.0060.00715.30
7.0.150.0060.00615.20
7.0.140.0080.00415.13
7.0.130.0040.00814.95
7.0.120.0110.00415.12
7.0.110.0000.00815.19
7.0.100.0040.01415.48
7.0.90.0070.00715.41
7.0.80.0070.01015.44
7.0.70.0060.01115.43
7.0.60.0100.00315.40
7.0.50.0030.01015.30
7.0.40.0030.01313.26
7.0.30.0070.00313.29
7.0.20.0060.00613.41
7.0.10.0070.01113.48
7.0.00.0040.01413.18
5.6.400.0050.00514.59
5.6.390.0100.00314.53
5.6.380.0030.01014.37
5.6.370.0040.00814.27
5.6.360.0030.00914.15
5.6.350.0000.01314.27
5.6.340.0040.00414.00
5.6.330.0050.00314.31
5.6.320.0070.01014.19
5.6.310.0070.01014.68
5.6.300.0110.00314.53
5.6.290.0120.00014.26
5.6.280.0080.00014.41
5.6.270.0060.00314.27
5.6.260.0030.01014.22
5.6.250.0040.00814.16
5.6.240.0100.00614.37
5.6.230.0030.01314.36
5.6.220.0060.00314.42
5.6.210.0130.00014.06
5.6.200.0110.00314.32
5.6.190.0110.00714.39
5.6.180.0100.00314.39
5.6.170.0100.00614.29
5.6.160.0030.01514.34
5.6.150.0070.01014.25
5.6.140.0040.00714.18
5.6.130.0030.01014.69
5.6.120.0060.00614.31
5.6.110.0140.00014.15
5.6.100.0040.01114.30
5.6.90.0060.00914.27
5.6.80.0070.00714.10
5.6.70.0050.00314.17
5.6.60.0060.00614.33
5.6.50.0030.01014.10
5.6.40.0060.00613.93
5.6.30.0000.00914.32
5.6.20.0030.01314.00
5.6.10.0030.01214.23
5.6.00.0090.00614.29

preferences:
181.32 ms | 403 KiB | 5 Q