3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Challenge 2: Implement AnswerInterface and get Question to echo "4". */ 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 // 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.0110.00416.63
8.3.50.0090.01122.12
8.3.40.0070.01118.79
8.3.30.0090.00619.01
8.3.20.0040.00420.38
8.3.10.0040.00421.82
8.3.00.0030.00619.19
8.2.180.0040.01818.29
8.2.170.0100.00722.96
8.2.160.0070.00722.27
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0050.00319.70
8.2.110.0100.00020.90
8.2.100.0090.00317.63
8.2.90.0000.00719.05
8.2.80.0000.00817.97
8.2.70.0040.00417.61
8.2.60.0000.00717.80
8.2.50.0030.00618.07
8.2.40.0060.00318.22
8.2.30.0040.00417.91
8.2.20.0030.00617.73
8.2.10.0000.00817.91
8.2.00.0040.00417.75
8.1.280.0130.01325.92
8.1.270.0070.00320.45
8.1.260.0060.00326.35
8.1.250.0030.00728.09
8.1.240.0030.00624.02
8.1.230.0000.01119.07
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00816.88
8.1.190.0080.00017.23
8.1.180.0040.00418.10
8.1.170.0000.00820.37
8.1.160.0040.00421.95
8.1.150.0070.00018.81
8.1.140.0040.00417.36
8.1.130.0030.00317.68
8.1.120.0000.00817.24
8.1.110.0000.00717.31
8.1.100.0000.00717.30
8.1.90.0080.00017.34
8.1.80.0040.00417.22
8.1.70.0070.00017.31
8.1.60.0030.00517.41
8.1.50.0060.00317.50
8.1.40.0040.00417.43
8.1.30.0040.00417.48
8.1.20.0040.00417.42
8.1.10.0050.00317.43
8.1.00.0030.00617.45
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0030.00318.43
8.0.270.0040.00417.15
8.0.260.0000.00617.20
8.0.250.0070.00016.93
8.0.240.0070.00016.97
8.0.230.0030.00316.86
8.0.220.0030.00316.90
8.0.210.0070.00016.89
8.0.200.0000.00716.97
8.0.190.0030.00516.98
8.0.180.0040.00416.81
8.0.170.0080.00016.99
8.0.160.0000.00816.87
8.0.150.0050.00316.73
8.0.140.0000.00716.73
8.0.130.0000.00613.25
8.0.120.0000.00816.70
8.0.110.0000.00716.71
8.0.100.0030.00316.87
8.0.90.0070.00016.77
8.0.80.0090.00616.89
8.0.70.0040.00416.78
8.0.60.0000.00716.93
8.0.50.0040.00416.76
8.0.30.0050.01516.98
8.0.20.0110.01017.40
8.0.10.0000.00816.82
8.0.00.0060.01316.75
7.4.330.0000.00615.03
7.4.320.0060.00016.46
7.4.300.0030.00316.50
7.4.290.0040.00416.54
7.4.280.0040.00416.43
7.4.270.0030.00316.52
7.4.260.0030.00516.42
7.4.250.0000.00716.40
7.4.240.0020.00516.50
7.4.230.0070.00016.35
7.4.220.0170.00316.42
7.4.210.0070.00716.55
7.4.200.0070.00016.34
7.4.160.0070.01016.41
7.4.150.0090.00917.40
7.4.140.0130.00617.86
7.4.130.0070.01016.44
7.4.120.0070.01016.53
7.4.110.0150.00916.48
7.4.100.0130.00716.59
7.4.90.0030.01516.42
7.4.80.0230.00316.61
7.4.70.0060.01016.42
7.4.60.0070.01016.68
7.4.50.0030.00616.68
7.4.40.0100.01016.39
7.4.30.0000.01816.35
7.4.00.0070.01114.87
7.3.330.0040.00413.29
7.3.320.0110.00513.16
7.3.310.0030.00316.15
7.3.300.0030.00316.13
7.3.290.0100.00816.28
7.3.280.0130.00416.25
7.3.270.0090.00917.40
7.3.260.0120.00616.39
7.3.250.0130.00416.46
7.3.240.0100.00916.47
7.3.230.0120.00616.43
7.3.210.0070.01016.31
7.3.200.0090.00919.39
7.3.190.0100.00716.59
7.3.180.0120.00316.36
7.3.170.0130.01016.55
7.3.160.0060.01816.52
7.3.120.0100.01014.84
7.3.110.0070.01014.77
7.3.100.0040.01114.88
7.3.90.0100.00314.71
7.3.80.0030.01014.80
7.3.70.0080.00314.82
7.3.60.0080.00814.94
7.3.50.0120.00414.75
7.3.40.0090.00614.66
7.3.30.0090.00314.86
7.3.20.0110.00416.68
7.3.10.1460.00715.65
7.3.00.1680.00615.49
7.2.330.0090.00916.59
7.2.320.0130.00416.46
7.2.310.0140.00816.66
7.2.300.0030.01316.39
7.2.290.0100.01016.23
7.2.250.0080.00614.83
7.2.240.0130.00615.03
7.2.230.0030.00914.80
7.2.220.0070.01114.93
7.2.210.0100.00314.82
7.2.200.0030.00914.77
7.2.190.0030.00915.00
7.2.180.0070.00714.92
7.2.170.0090.00614.88
7.2.160.0110.00015.03
7.2.150.0000.01416.66
7.2.140.0060.00916.81
7.2.130.1320.01015.77
7.2.120.1230.01415.80
7.2.110.0750.00815.10
7.2.100.0370.01015.02
7.2.90.0540.00814.98
7.2.80.0590.01014.98
7.2.70.0810.00915.21
7.2.60.0500.00915.31
7.2.50.0450.00815.23
7.2.40.0640.01115.08
7.2.30.0390.00915.08
7.2.20.0590.00815.18
7.2.10.0540.00715.03
7.2.00.0330.01015.79
7.1.330.0060.00915.68
7.1.320.0000.01515.73
7.1.310.0030.01315.43
7.1.300.0060.00615.68
7.1.290.0070.00715.49
7.1.280.0000.01215.70
7.1.270.0030.01015.46
7.1.260.0030.01015.66
7.1.250.1370.00214.67
7.1.240.1190.00514.63
7.1.230.0670.00814.03
7.1.220.0830.00914.07
7.1.210.0290.01013.86
7.1.200.0690.00814.25
7.1.190.0810.00713.91
7.1.180.0570.01014.00
7.1.170.0510.00613.98
7.1.160.0520.00914.05
7.1.150.0380.00714.14
7.1.140.0380.00813.97
7.1.130.0410.00813.95
7.1.120.0380.00814.00
7.1.110.0450.00713.90
7.1.100.0340.00614.50
7.1.90.0310.00813.97
7.1.80.0290.00713.96
7.1.70.0210.00614.53
7.1.60.0330.01324.05
7.1.50.0270.01223.50
7.1.40.0310.01024.79
7.1.30.0370.00724.61
7.1.20.0780.01124.76
7.1.10.0270.00513.97
7.1.00.0210.01815.33
7.0.330.2980.01313.36
7.0.320.2190.00313.32
7.0.310.0650.00913.43
7.0.300.0700.00813.37
7.0.290.0820.00713.37
7.0.280.0440.00813.37
7.0.270.0570.00513.45
7.0.260.0500.00713.35
7.0.250.0520.00413.54
7.0.240.0600.00713.46
7.0.230.0460.01113.55
7.0.220.0440.00813.37
7.0.210.1260.00613.34
7.0.200.0420.00713.63
7.0.190.0970.00913.53
7.0.180.0320.00813.36
7.0.170.0330.00813.46
7.0.160.0390.00813.41
7.0.150.0350.00713.50
7.0.140.0270.02015.16
7.0.130.0320.01013.47
7.0.120.0300.00813.57
7.0.110.0270.01914.73
7.0.100.0280.02214.71
7.0.90.0270.02114.76
7.0.80.0250.02114.63
7.0.70.0330.01514.78
7.0.60.0290.02314.72
7.0.50.0250.02214.80
7.0.40.0270.01814.70
7.0.30.0280.01914.73
7.0.20.0220.02414.74
7.0.10.0240.02114.62
7.0.00.0900.02114.82
5.6.380.0090.00714.19
5.6.370.0100.01114.25
5.6.360.0120.00914.06
5.6.350.0140.00914.18
5.6.340.0160.00714.13
5.6.330.0160.00814.15
5.6.320.0150.00614.19
5.6.310.0130.01114.22
5.6.300.0110.01114.16
5.6.290.0160.00814.18
5.6.280.0070.02315.46
5.6.270.0100.00914.24
5.6.260.0130.02015.50
5.6.250.0130.02115.42
5.6.240.0090.02515.48
5.6.230.0140.01915.45
5.6.220.0140.01815.45
5.6.210.0110.02415.49
5.6.200.0140.02115.42
5.6.190.0090.01915.42
5.6.180.0100.02115.44
5.6.170.0140.02115.36
5.6.160.0150.02115.48
5.6.150.0100.02515.39
5.6.140.0100.02415.40
5.6.130.0120.02115.47
5.6.120.0060.02915.53
5.6.110.0090.02715.42
5.6.100.0140.02315.46
5.6.90.0120.02415.36
5.6.80.0120.02415.11
5.6.70.0130.01315.23
5.6.60.0120.02115.27
5.6.50.0120.01515.18
5.6.40.0090.02215.21
5.6.30.0120.01215.23
5.6.20.0120.02115.19
5.6.10.0140.01915.21
5.6.00.0130.02115.20
5.5.380.0130.01812.54
5.5.370.0100.01812.45
5.5.360.0100.02012.54
5.5.350.0110.02112.45
5.5.340.0150.01612.56
5.5.330.0090.01412.52
5.5.320.0080.01812.54
5.5.310.0120.01612.57
5.5.300.0140.01612.59
5.5.290.0110.01712.58
5.5.280.0080.02212.59
5.5.270.0120.01812.54
5.5.260.0090.02012.61
5.5.250.0090.02112.52
5.5.240.0110.01812.45
5.5.230.0070.01912.44
5.5.220.0110.01712.47
5.5.210.0090.01112.49
5.5.200.0090.01912.39
5.5.190.0060.02112.40
5.5.180.0110.00812.47
5.5.170.0130.00613.15
5.5.160.0080.02112.36
5.5.150.0060.02112.32
5.5.140.0090.01712.44
5.5.130.0120.01812.35
5.5.120.0070.02212.45
5.5.110.0090.02012.47
5.5.100.0060.02312.44
5.5.90.0100.01312.44
5.5.80.0080.02012.41
5.5.70.0110.01912.42
5.5.60.0080.02212.48
5.5.50.0110.01712.39
5.5.40.0090.01912.42
5.5.30.0110.01712.43
5.5.20.0110.01812.39
5.5.10.0110.01712.35
5.5.00.0090.01912.38
5.4.450.0100.02012.83
5.4.440.0090.01512.82
5.4.430.0090.01412.86
5.4.420.0090.01412.77
5.4.410.0110.01812.85
5.4.400.0120.01812.73
5.4.390.0080.02212.77
5.4.380.0080.01212.70
5.4.370.0120.01512.76
5.4.360.0080.01412.76
5.4.350.0090.02012.71
5.4.340.0110.01712.73
5.4.330.0080.00611.16
5.4.320.0120.00912.72
5.4.310.0070.01912.73
5.4.300.0070.02112.65
5.4.290.0100.02112.71
5.4.280.0100.01912.80
5.4.270.0110.01712.78
5.4.260.0080.02212.71
5.4.250.0090.01912.68
5.4.240.0090.01712.78
5.4.230.0090.01912.73
5.4.220.0120.01512.74
5.4.210.0090.02012.75
5.4.200.0070.02212.72
5.4.190.0090.01212.70
5.4.180.0110.01812.77
5.4.170.0080.01712.79
5.4.160.0120.01812.68
5.4.150.0100.01912.76
5.4.140.0090.01912.16
5.4.130.0100.01912.26
5.4.120.0080.02012.25
5.4.110.0080.01912.22
5.4.100.0100.01812.27
5.4.90.0110.01712.23
5.4.80.0100.01712.28
5.4.70.0080.02012.21
5.4.60.0100.01612.27
5.4.50.0090.01912.23
5.4.40.0100.01812.22
5.4.30.0080.01512.15
5.4.20.0080.01912.21
5.4.10.0110.01112.22
5.4.00.0120.01712.09

preferences:
52.65 ms | 401 KiB | 5 Q