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 { } // 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.60.0050.01018.27
8.3.50.0090.00722.01
8.3.40.0170.00318.84
8.3.30.0070.00718.92
8.3.20.0050.00320.16
8.3.10.0070.00021.92
8.3.00.0040.00422.46
8.2.180.0070.01416.50
8.2.170.0170.00322.96
8.2.160.0120.00320.80
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0080.00017.50
8.2.110.0030.00722.13
8.2.100.0080.00317.72
8.2.90.0070.00019.08
8.2.80.0000.00917.97
8.2.70.0000.00817.38
8.2.60.0050.00317.68
8.2.50.0030.00618.07
8.2.40.0050.00218.09
8.2.30.0000.00817.98
8.2.20.0040.00417.64
8.2.10.0000.00717.66
8.2.00.0050.00317.71
8.1.280.0110.00425.92
8.1.270.0040.00422.01
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.75
8.1.230.0110.00519.16
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.00
8.1.190.0040.00417.16
8.1.180.0040.00418.10
8.1.170.0040.00418.44
8.1.160.0040.00422.02
8.1.150.0000.00718.57
8.1.140.0040.00417.45
8.1.130.0050.00217.63
8.1.120.0030.00317.40
8.1.110.0030.00717.39
8.1.100.0040.00417.40
8.1.90.0080.00017.22
8.1.80.0050.00317.45
8.1.70.0030.00317.28
8.1.60.0030.00617.52
8.1.50.0000.00717.43
8.1.40.0040.00417.48
8.1.30.0040.00417.45
8.1.20.0000.00817.49
8.1.10.0000.00817.37
8.1.00.0040.00417.24
8.0.300.0040.00418.77
8.0.290.0030.00517.05
8.0.280.0030.00318.38
8.0.270.0000.00717.19
8.0.260.0030.00316.87
8.0.250.0050.00316.82
8.0.240.0040.00416.81
8.0.230.0000.00716.82
8.0.220.0030.00316.89
8.0.210.0030.00416.91
8.0.200.0060.00016.94
8.0.190.0050.00316.98
8.0.180.0000.00716.84
8.0.170.0000.01016.90
8.0.160.0080.00016.81
8.0.150.0000.00716.88
8.0.140.0040.00416.73
8.0.130.0030.00313.26
8.0.120.0030.00516.77
8.0.110.0000.00916.93
8.0.100.0040.00416.75
8.0.90.0030.00516.71
8.0.80.0150.00316.95
8.0.70.0040.00416.84
8.0.60.0030.00516.80
8.0.50.0070.00016.74
8.0.30.0100.00916.98
8.0.20.0140.00617.40
8.0.10.0050.00216.91
8.0.00.0090.00816.73
7.4.330.0020.00215.08
7.4.320.0070.00016.45
7.4.300.0030.00316.59
7.4.290.0000.00716.48
7.4.280.0040.00416.43
7.4.270.0000.00616.44
7.4.260.0060.00016.46
7.4.250.0040.00716.45
7.4.240.0020.00616.51
7.4.230.0030.00316.41
7.4.220.0080.01316.41
7.4.210.0050.01216.51
7.4.200.0040.00416.27
7.4.190.0030.00316.29
7.4.160.0090.00916.48
7.4.150.0120.00617.40
7.4.140.0130.00617.86
7.4.130.0110.01216.36
7.4.120.0100.00716.41
7.4.110.0060.01616.59
7.4.100.0060.01116.34
7.4.90.0140.00516.40
7.4.80.0060.01619.39
7.4.70.0140.00316.36
7.4.60.0090.01116.15
7.4.50.0040.00416.53
7.4.40.0060.00722.77
7.4.30.0080.00816.54
7.4.00.0070.00914.68
7.3.330.0050.00013.23
7.3.320.0030.00313.09
7.3.310.0000.00816.09
7.3.300.0000.00716.24
7.3.290.0100.00316.25
7.3.280.0160.00416.24
7.3.270.0040.01417.40
7.3.260.0070.01016.21
7.3.250.0140.00616.42
7.3.240.0170.00316.43
7.3.230.0100.00716.39
7.3.210.0070.01016.25
7.3.200.0150.00816.45
7.3.190.0130.00316.36
7.3.180.0000.01616.44
7.3.170.0060.00916.52
7.3.160.0140.00716.26
7.3.120.0050.01314.76
7.3.110.0050.01214.85
7.3.100.0030.01114.54
7.3.90.0080.01014.59
7.3.80.0050.00914.79
7.3.70.0070.00914.70
7.3.60.0070.00514.81
7.3.50.0060.00614.68
7.3.40.0060.00314.63
7.3.30.0090.00514.41
7.3.20.0090.00516.38
7.3.10.0080.00316.57
7.3.00.0050.00916.51
7.2.330.0180.00316.52
7.2.320.0040.01316.52
7.2.310.0110.00716.59
7.2.300.0070.01016.54
7.2.290.0140.00316.46
7.2.250.0070.01114.71
7.2.240.0050.01114.65
7.2.230.0050.01214.92
7.2.220.0090.00315.04
7.2.210.0050.01014.67
7.2.200.0040.00914.99
7.2.190.0060.00814.98
7.2.180.0050.00814.89
7.2.170.0050.00914.59
7.2.60.0070.01016.45
7.1.330.0060.00715.53
7.1.320.0090.00415.70
7.1.310.0060.00515.43
7.1.300.0070.00615.53
7.1.290.0060.00415.38
7.1.280.0080.00515.59
7.1.270.0060.00615.57
7.1.260.0050.00515.51
7.1.200.0030.00915.63
7.1.70.0000.00817.05
7.1.60.0100.01419.82
7.1.50.0090.01216.54
7.1.00.0000.08022.45
7.0.200.0030.00316.65
7.0.140.0070.07022.04
7.0.60.0100.04719.98
7.0.50.0070.06017.84
7.0.40.0030.08020.40
7.0.30.0270.05720.23
7.0.20.0300.07720.09
7.0.10.0030.04320.21
7.0.00.0000.09320.16
5.6.280.0000.07321.10
5.6.210.0100.07720.77
5.6.200.0070.08018.16
5.6.190.0070.04020.53
5.6.180.0500.04720.63
5.6.170.0300.04720.39
5.6.160.0100.08020.62
5.6.150.0130.06718.15
5.6.140.0170.07018.17
5.6.130.0000.09018.14
5.6.120.0070.04721.14
5.6.110.0070.09021.12
5.6.100.0130.07320.89
5.6.90.0100.08720.94
5.6.80.0030.08720.41
5.5.350.0330.06320.34
5.5.340.0030.07017.99
5.5.330.0030.05720.19
5.5.320.0470.06020.34
5.5.310.0330.07720.42
5.5.300.0030.04718.04
5.5.290.0070.08718.03
5.5.280.0070.08320.85
5.5.270.0070.08720.75
5.5.260.0000.04720.85
5.5.250.0000.09020.72
5.5.240.0000.04320.35
5.4.450.0470.06319.61
5.4.440.0970.06019.47
5.4.430.0130.05019.36
5.4.420.0070.05719.68
5.4.410.0170.05019.03
5.4.400.0100.05018.79
5.4.390.0070.06718.56
5.4.380.0030.06018.48
5.4.370.0230.04718.75
5.4.360.0100.06018.54
5.4.350.0130.07318.71
5.4.340.0270.04718.60
5.4.320.0060.03512.50
5.4.310.0050.04012.50
5.4.300.0050.03712.50
5.4.290.0070.04312.50
5.4.280.0060.03512.40
5.4.270.0100.05719.00
5.4.260.0070.07718.99
5.4.250.0170.04718.90
5.4.240.0070.05318.84
5.4.230.0300.05019.13
5.4.220.0030.06318.84
5.4.210.0130.08018.95
5.4.200.0130.07319.02
5.4.190.0030.05719.00
5.4.180.0100.05318.91
5.4.170.0100.07318.98
5.4.160.0170.07018.81
5.4.150.0100.06319.11
5.4.140.0170.06016.76
5.4.130.0100.05316.68
5.4.120.0100.05316.45
5.4.110.0130.05016.73
5.4.100.0030.07016.47
5.4.90.0070.07316.70
5.4.80.0070.06716.61
5.4.70.0030.05716.72
5.4.60.0070.06316.40
5.4.50.0130.04716.39
5.4.40.0130.05316.44
5.4.30.0130.04316.39
5.4.20.0070.06716.39
5.4.10.0130.05016.61
5.4.00.0170.04716.13
5.3.290.0050.04012.80
5.3.280.0200.04314.87
5.3.270.0070.05714.50
5.3.260.0100.05014.88
5.3.250.0070.05314.79
5.3.240.0100.05714.49
5.3.230.0130.06714.65
5.3.220.0130.06014.45
5.3.210.0170.05714.80
5.3.200.0170.05714.85
5.3.190.0170.05314.79
5.3.180.0100.06714.79
5.3.170.0130.06014.84
5.3.160.0100.05714.77
5.3.150.0170.04714.83
5.3.140.0100.05314.59
5.3.130.0100.06314.75
5.3.120.0100.06014.84
5.3.110.0030.05714.43
5.3.100.0170.04714.23
5.3.90.0070.05714.31
5.3.80.0130.06314.22
5.3.70.0200.04014.23
5.3.60.0070.06014.28
5.3.50.0070.05313.99
5.3.40.0070.06014.14
5.3.30.0100.06714.11
5.3.20.0100.06713.91
5.3.10.0100.05013.84
5.3.00.0130.06713.64
5.2.170.0030.06311.12
5.2.160.0070.04711.32
5.2.150.0100.04011.20
5.2.140.0000.05311.33
5.2.130.0070.04311.39
5.2.120.0070.03711.29
5.2.110.0100.03311.06
5.2.100.0030.04011.32
5.2.90.0070.04311.41
5.2.80.0030.05011.22
5.2.70.0130.04011.36
5.2.60.0170.03711.27
5.2.50.0070.04011.19
5.2.40.0030.05711.00
5.2.30.0070.04011.15
5.2.20.0030.04711.18
5.2.10.0130.03311.15
5.2.00.0070.04010.93
5.1.60.0000.04010.29
5.1.50.0030.03310.21
5.1.40.0100.0379.93
5.1.30.0130.03710.52
5.1.20.0130.03010.55
5.1.10.0070.0339.96
5.1.00.0100.03310.16
5.0.50.0070.0308.71
5.0.40.0070.0238.63
5.0.30.0030.0578.52
5.0.20.0070.0338.46
5.0.10.0030.0278.46
5.0.00.0030.0508.21
4.4.90.0000.0277.78
4.4.80.0100.0237.78
4.4.70.0030.0207.78
4.4.60.0070.0177.78
4.4.50.0030.0237.78
4.4.40.0030.0337.78
4.4.30.0030.0207.78
4.4.20.0000.0277.78
4.4.10.0000.0337.78
4.4.00.0000.0477.78
4.3.110.0030.0237.78
4.3.100.0030.0307.78
4.3.90.0070.0207.78
4.3.80.0030.0337.78
4.3.70.0070.0237.78
4.3.60.0000.0277.78
4.3.50.0030.0237.78
4.3.40.0000.0377.78
4.3.30.0030.0207.78
4.3.20.0000.0237.78
4.3.10.0070.0277.78
4.3.00.0000.0237.17

preferences:
33.97 ms | 401 KiB | 5 Q