3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Question { public function __construct(AnswerInterface $answer) { echo "What is 2 + 2?\n"; $answer = $answer->get()->the()->answer(); if ($answer instanceof AnswerInterface) { echo $answer . PHP_EOL; } } } interface AnswerInterface { public function get(); public function the(); public function answer(); } // start editing here class Answer implements AnswerInterface { public function get(){ return $this; } public function the(){ return $this; } public function answer(){ return 4; } } // end editing here $answer = new Answer; $question = new Question($answer);

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.70.0110.00416.38
8.3.60.0090.00918.31
8.3.50.0020.01521.93
8.3.40.0070.00718.70
8.3.30.0070.00719.04
8.3.20.0000.00820.16
8.3.10.0050.00322.08
8.3.00.0040.00422.39
8.2.190.0160.00616.58
8.2.180.0140.00016.50
8.2.170.0150.00622.96
8.2.160.0030.01020.33
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00417.50
8.2.110.0050.00320.33
8.2.100.0040.00817.78
8.2.90.0030.00619.17
8.2.80.0000.00818.04
8.2.70.0060.00317.63
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0060.00318.11
8.2.30.0040.00417.98
8.2.20.0000.00717.54
8.2.10.0030.00517.61
8.2.00.0030.00617.75
8.1.280.0040.01125.92
8.1.270.0050.00222.25
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.79
8.1.230.0090.00319.02
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0000.00817.41
8.1.180.0060.00318.10
8.1.170.0050.00518.38
8.1.160.0000.00822.02
8.1.150.0000.00718.64
8.1.140.0030.00517.46
8.1.130.0030.00617.79
8.1.120.0040.00417.36
8.1.110.0030.00517.45
8.1.100.0030.00317.48
8.1.90.0040.00417.38
8.1.80.0070.00017.44
8.1.70.0030.00317.32
8.1.60.0040.00417.57
8.1.50.0000.00817.51
8.1.40.0080.00017.44
8.1.30.0000.00817.68
8.1.20.0020.00517.69
8.1.10.0070.00017.59
8.1.00.0030.00517.49
8.0.300.0070.00018.77
8.0.290.0040.00417.16
8.0.280.0040.00418.32
8.0.270.0030.00417.29
8.0.260.0040.00416.82
8.0.250.0070.00417.02
8.0.240.0030.00316.91
8.0.230.0040.00417.02
8.0.220.0000.00716.97
8.0.210.0070.00016.93
8.0.200.0030.00317.00
8.0.190.0030.00317.02
8.0.180.0040.00416.96
8.0.170.0060.00317.04
8.0.160.0070.00016.99
8.0.150.0000.00716.91
8.0.140.0000.00716.93
8.0.130.0040.00413.35
8.0.120.0000.00716.82
8.0.110.0070.00016.88
8.0.100.0000.00816.75
8.0.90.0030.00516.79
8.0.80.0090.00616.91
8.0.70.0040.00417.02
8.0.60.0040.00416.91
8.0.50.0000.00716.90
8.0.30.0070.01217.04
8.0.20.0080.01017.40
8.0.10.0040.00417.19
8.0.00.0100.00816.68
7.4.330.0050.00015.10
7.4.320.0030.00616.37
7.4.300.0030.00316.61
7.4.290.0030.00316.55
7.4.280.0040.00416.47
7.4.270.0030.00316.37
7.4.260.0000.00816.39
7.4.250.0000.00816.56
7.4.240.0020.00616.61
7.4.230.0030.00316.56
7.4.220.0060.01916.46
7.4.210.0100.00716.67
7.4.200.0000.00816.71
7.4.190.0040.00416.77
7.4.160.0070.01416.80
7.4.150.0030.01417.40
7.4.140.0150.00717.86
7.4.130.0080.01216.41
7.4.120.0080.01016.71
7.4.110.0030.01316.44
7.4.100.0090.00916.59
7.4.90.0110.01116.57
7.4.80.0110.01219.39
7.4.70.0090.00916.52
7.4.60.0130.00316.45
7.4.50.0090.00016.46
7.4.40.0060.01222.77
7.4.30.0030.01316.74
7.4.00.0140.00315.10
7.3.330.0020.00313.18
7.3.320.0050.00013.12
7.3.310.0000.00716.37
7.3.300.0030.00316.30
7.3.290.0090.00616.44
7.3.280.0050.01216.35
7.3.270.0150.00917.40
7.3.260.0030.01416.36
7.3.250.0100.00916.47
7.3.240.0080.00916.51
7.3.230.0110.00816.46
7.3.210.0130.00316.50
7.3.200.0110.00719.39
7.3.190.0110.01116.61
7.3.180.0130.00316.52
7.3.170.0040.01516.41
7.3.160.0140.00316.44
7.3.120.0040.01114.93
7.3.10.0050.00516.48
7.3.00.0110.00416.52
7.2.330.0030.01316.77
7.2.320.0130.01516.46
7.2.310.0090.00916.30
7.2.300.0150.00616.57
7.2.290.0090.00716.44
7.2.130.0090.00616.99
7.2.120.0030.01016.81
7.2.110.0070.00717.00
7.2.100.0030.01316.91
7.2.90.0070.00416.69
7.2.80.0040.01216.98
7.2.70.0070.00716.86
7.2.60.0020.01217.00
7.2.50.0000.01517.07
7.2.40.0060.00916.25
7.2.30.0060.00616.29
7.2.20.0040.01117.03
7.2.10.0080.00316.83
7.2.00.0040.00917.86
7.1.250.0030.01015.82
7.1.200.0100.00315.75
7.1.70.0030.00617.00
7.1.60.0080.00416.91
7.1.50.0220.00934.48
7.1.00.0000.07722.51
7.0.200.0070.00716.46
7.0.140.0100.06322.15
7.0.60.0030.07020.03
7.0.50.0000.05017.95
7.0.40.0070.04320.11
7.0.30.0470.05020.06
7.0.20.0430.05720.06
7.0.10.0270.05020.06
7.0.00.0030.05320.15
5.6.280.0000.07720.93
5.6.210.0070.08020.66
5.6.200.0070.05318.25
5.6.190.0130.08020.43
5.6.180.0300.07720.34
5.6.170.0230.08720.39
5.6.160.0100.08320.71
5.6.150.0100.06718.29
5.6.140.0000.04318.15
5.6.130.0000.04318.18
5.6.120.0070.07721.00
5.6.110.0100.04021.01
5.6.100.0100.08021.14
5.6.90.0130.06021.04
5.6.80.0030.04020.37
5.6.70.0270.07020.43
5.5.350.0170.05320.33
5.5.340.0100.07317.95
5.5.330.0100.04720.13
5.5.320.0370.07720.42
5.5.310.0370.03020.30
5.5.300.0230.07317.95
5.5.290.0030.06317.95
5.5.280.0070.05020.66
5.5.270.0130.08320.89
5.5.260.0130.07320.68
5.5.250.0100.03720.61
5.5.240.0070.06720.19
5.4.450.0200.05019.37
5.4.440.0130.06019.48
5.4.430.0570.04719.44
5.4.420.0400.06719.60
5.4.410.0300.05719.36
5.4.400.0070.05318.81
5.4.390.0030.06018.76
5.4.380.0330.07318.63
5.4.370.0200.05018.65
5.4.360.0270.04718.65
5.4.350.0330.04718.75
5.4.340.0230.04718.71
5.4.320.0100.04512.51
5.4.310.0090.04312.50
5.4.300.0050.04212.51
5.4.290.0100.04712.51
5.4.280.0050.03612.40
5.4.270.0030.06018.84
5.4.260.0000.06318.91
5.4.250.0170.06719.02
5.4.240.0100.07318.91
5.4.230.0070.05318.86
5.4.220.0070.05718.99
5.4.210.0030.06018.95
5.4.200.0070.06018.86
5.4.190.0100.05018.97
5.4.180.0200.04318.95
5.4.170.0070.08018.85
5.4.160.0170.05018.86
5.4.150.0000.06718.98
5.4.140.0000.06016.67
5.4.130.0270.03016.66
5.4.120.0100.06016.75
5.4.110.0170.05716.70
5.4.100.0130.05016.68
5.4.90.0070.05316.77
5.4.80.0100.04716.45
5.4.70.0100.04716.67
5.4.60.0130.04716.66
5.4.50.0070.05316.63
5.4.40.0100.05716.44
5.4.30.0100.05016.65
5.4.20.0030.06016.59
5.4.10.0070.07016.60
5.4.00.0130.05315.84
5.3.290.0070.04112.80
5.3.280.0200.05314.60
5.3.270.0030.07314.88
5.3.260.0100.05714.67
5.3.250.0070.06014.73
5.3.240.0100.05014.84
5.3.230.0170.06714.78
5.3.220.0070.06714.70
5.3.210.0070.05714.87
5.3.200.0170.05014.75
5.3.190.0100.06014.80
5.3.180.0200.06314.63
5.3.170.0030.05714.43
5.3.160.0070.07014.76
5.3.150.0030.05714.84
5.3.140.0100.06714.74
5.3.130.0070.06714.61
5.3.120.0130.06014.85
5.3.110.0070.06014.79
5.3.100.0100.05714.04
5.3.90.0000.06314.02
5.3.80.0000.05714.24
5.3.70.0100.04713.90
5.3.60.0130.05314.27
5.3.50.0000.05714.14
5.3.40.0070.05714.24
5.3.30.0100.07314.21
5.3.20.0100.06313.70
5.3.10.0100.04313.65
5.3.00.0130.04713.82
5.2.170.0030.05011.37
5.2.160.0070.04311.42
5.2.150.0100.05311.43
5.2.140.0070.04311.14
5.2.130.0070.04311.10
5.2.120.0070.04011.29
5.2.110.0130.04711.41
5.2.100.0070.04311.33
5.2.90.0100.05711.16
5.2.80.0000.05011.30
5.2.70.0100.05311.41
5.2.60.0100.03711.09
5.2.50.0070.05010.91
5.2.40.0130.05311.06
5.2.30.0130.03311.16
5.2.20.0070.05710.96
5.2.10.0070.04010.92
5.2.00.0100.05010.73
5.1.60.0070.04010.27
5.1.50.0070.0339.89
5.1.40.0100.03010.15
5.1.30.0000.05710.63
5.1.20.0070.03310.50
5.1.10.0070.04010.36
5.1.00.0100.03310.39
5.0.50.0100.0208.55
5.0.40.0070.0378.70
5.0.30.0030.0478.53
5.0.20.0000.0438.42
5.0.10.0070.0338.50
5.0.00.0100.0438.39
4.4.90.0000.0277.37
4.4.80.0000.0307.37
4.4.70.0000.0277.37
4.4.60.0000.0277.37
4.4.50.0070.0237.37
4.4.40.0030.0337.37
4.4.30.0070.0177.37
4.4.20.0070.0177.37
4.4.10.0030.0207.37
4.4.00.0000.0437.37
4.3.110.0000.0277.37
4.3.100.0030.0277.37
4.3.90.0000.0237.37
4.3.80.0000.0407.37
4.3.70.0030.0207.37
4.3.60.0000.0237.37
4.3.50.0000.0377.37
4.3.40.0100.0407.37
4.3.30.0030.0307.37
4.3.20.0000.0237.37
4.3.10.0000.0237.37
4.3.00.0070.0175.73

preferences:
29.61 ms | 401 KiB | 5 Q