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.0140.00318.56
8.3.50.0100.00621.08
8.3.40.0070.00718.67
8.3.30.0100.01019.18
8.3.20.0080.00020.34
8.3.10.0040.00422.09
8.3.00.0000.00722.46
8.2.180.0180.00316.88
8.2.170.0140.00022.96
8.2.160.0070.00720.48
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0180.00026.16
8.2.120.0040.00419.54
8.2.110.0130.00722.20
8.2.100.0110.00019.47
8.2.90.0040.00419.16
8.2.80.0000.00719.35
8.2.70.0080.00017.50
8.2.60.0050.00317.80
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0000.00818.02
8.2.20.0100.00017.71
8.2.10.0040.00417.69
8.2.00.0040.00417.61
8.1.280.0100.00325.92
8.1.270.0040.00420.16
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0000.00924.00
8.1.230.0000.01119.01
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0080.00317.22
8.1.190.0040.00417.39
8.1.180.0040.00418.67
8.1.170.0000.00818.54
8.1.160.0050.00222.07
8.1.150.0050.00518.39
8.1.140.0000.00817.32
8.1.130.0000.00717.76
8.1.120.0000.00717.41
8.1.110.0040.00417.23
8.1.100.0000.01117.18
8.1.90.0000.00717.20
8.1.80.0070.00017.39
8.1.70.0030.00317.23
8.1.60.0030.00617.39
8.1.50.0040.00417.47
8.1.40.0040.00417.50
8.1.30.0000.00717.56
8.1.20.0000.00817.61
8.1.10.0030.00617.52
8.1.00.0020.00517.34
8.0.300.0000.00718.77
8.0.290.0070.00017.05
8.0.280.0070.00018.33
8.0.270.0070.00017.23
8.0.260.0000.00616.78
8.0.250.0000.00716.95
8.0.240.0050.00216.82
8.0.230.0000.00816.86
8.0.220.0040.00316.91
8.0.210.0030.00316.84
8.0.200.0000.00616.98
8.0.190.0040.00416.86
8.0.180.0000.00816.80
8.0.170.0050.00316.95
8.0.160.0040.00316.79
8.0.150.0030.00516.79
8.0.140.0030.00716.93
8.0.130.0000.00513.34
8.0.120.0070.00016.86
8.0.110.0040.00416.79
8.0.100.0000.00816.87
8.0.90.0040.00416.73
8.0.80.0070.00916.81
8.0.70.0090.00816.88
8.0.60.0100.00616.80
8.0.50.0100.00516.79
8.0.30.0070.01016.95
8.0.20.0080.00917.12
8.0.10.0090.00816.93
8.0.00.0070.01016.81
7.4.330.0000.00515.00
7.4.320.0000.00616.49
7.4.300.0000.00716.56
7.4.290.0000.00716.55
7.4.280.0030.00316.51
7.4.270.0040.00416.46
7.4.260.0030.00316.49
7.4.250.0000.00716.35
7.4.240.0030.00316.50
7.4.230.0020.00516.40
7.4.220.0010.01316.34
7.4.210.0060.00916.51
7.4.200.0070.00716.60
7.4.190.0090.00716.45
7.4.180.0050.01116.46
7.4.160.0090.00716.54
7.4.150.0070.00916.65
7.4.140.0090.00916.95
7.4.130.0080.00816.42
7.4.120.0100.00716.41
7.4.110.0080.00916.46
7.4.100.0060.01216.54
7.4.90.0090.00816.40
7.4.80.0110.00717.14
7.4.70.0100.00816.34
7.4.60.0070.00816.38
7.4.50.0060.00616.30
7.4.40.0070.01017.91
7.4.30.0050.01016.39
7.4.20.0070.00716.27
7.4.10.0040.01216.07
7.4.00.0090.00715.89
7.3.330.0020.00213.25
7.3.320.0020.00213.31
7.3.310.0070.00016.27
7.3.300.0020.00616.22
7.3.290.0100.00516.29
7.3.280.0080.01016.27
7.3.270.0090.00816.55
7.3.260.0060.01016.25
7.3.250.0110.00716.26
7.3.240.0080.01016.24
7.3.230.0070.01116.32
7.3.220.0060.00916.19
7.3.210.0090.00616.25
7.3.200.0110.00816.99
7.3.190.0110.00816.22
7.3.180.0100.00916.19
7.3.170.0130.00416.24
7.3.160.0120.00616.23
7.3.150.0100.00816.14
7.3.140.0070.00916.13
7.3.130.0080.00815.83
7.3.120.0090.00815.56
7.3.110.0050.01115.83
7.3.100.0090.00815.82
7.3.90.0080.00716.06
7.3.80.0050.00815.84
7.3.70.0080.00715.84
7.3.60.0090.00515.89
7.3.50.0080.00715.92
7.3.40.0060.00815.83
7.3.30.0070.00615.93
7.3.20.0070.00716.87
7.3.10.0090.00516.75
7.3.00.0080.00716.72
7.2.340.0150.00516.23
7.2.330.0130.00716.26
7.2.320.0120.00916.30
7.2.310.0130.01016.19
7.2.300.0150.00616.28
7.2.290.0120.01016.20
7.2.280.0130.00816.19
7.2.270.0100.01116.22
7.2.260.0120.00815.93
7.2.250.0090.01015.85
7.2.240.0090.00915.94
7.2.230.0120.00915.85
7.2.220.0130.01015.93
7.2.210.0130.00815.96
7.2.200.0100.01016.01
7.2.190.0140.00815.93
7.2.180.0110.00915.98
7.2.170.0140.00616.05
7.2.160.0130.00716.00
7.2.150.0110.01117.00
7.2.140.0150.00816.95
7.2.130.0130.00917.06
7.2.120.0140.00616.92
7.2.110.0120.00816.94
7.2.100.0100.01016.97
7.2.90.0130.00717.00
7.2.80.0130.00616.91
7.2.70.0140.00616.92
7.2.60.0130.00517.01
7.2.50.0090.00916.96
7.2.40.0140.00617.05
7.2.30.0130.00716.99
7.2.20.0130.00816.93
7.2.10.0100.01117.03
7.2.00.0080.01017.51
7.1.330.0090.00915.91
7.1.320.0180.00915.80
7.1.310.0120.00715.84
7.1.300.0120.00915.90
7.1.290.0110.00715.94
7.1.280.0140.00815.88
7.1.270.0080.00815.89
7.1.260.0120.00715.81
7.1.250.0130.00715.86
7.1.240.0100.00815.77
7.1.230.0080.00815.82
7.1.220.0130.00715.93
7.1.210.0090.01015.89
7.1.200.0130.00415.83
7.1.190.0120.00615.87
7.1.180.0140.00415.73
7.1.170.0120.00615.87
7.1.160.0100.00815.83
7.1.150.0150.00615.81
7.1.140.0100.00715.88
7.1.130.0120.00615.82
7.1.120.0130.00615.72
7.1.110.0120.00815.84
7.1.100.0120.00616.21
7.1.90.0110.00715.85
7.1.80.0130.00615.91
7.1.70.0150.00715.93
7.1.60.0130.00816.58
7.1.50.0080.00816.00
7.1.40.0120.00515.86
7.1.30.0090.01015.88
7.1.20.0100.00915.83
7.1.10.0130.00615.83
7.1.00.0100.01417.15
7.0.330.0110.00815.49
7.0.320.0090.00815.51
7.0.310.0100.00715.49
7.0.300.0120.00615.60
7.0.290.0090.00815.46
7.0.280.0100.00815.49
7.0.270.0120.00415.53
7.0.260.0130.00515.55
7.0.250.0120.00615.74
7.0.240.0190.00715.67
7.0.230.0120.00615.74
7.0.220.0110.00815.60
7.0.210.0140.00415.58
7.0.200.0110.00415.82
7.0.190.0150.00515.72
7.0.180.0110.00615.58
7.0.170.0070.00915.63
7.0.160.0080.00915.51
7.0.150.0120.00615.54
7.0.140.0100.01916.86
7.0.130.0100.00715.54
7.0.120.0120.00615.54
7.0.110.0110.00615.55
7.0.100.0130.00615.60
7.0.90.0100.00715.53
7.0.80.0110.00515.51
7.0.70.1060.01316.48
7.0.60.0090.01316.39
7.0.50.0250.01115.99
7.0.40.0130.01715.61
7.0.30.0150.02515.66
7.0.20.0090.02415.60
7.0.10.0150.01715.56
7.0.00.0110.02015.60
5.6.400.0110.00415.28
5.6.390.0140.00615.23
5.6.380.0080.01015.18
5.6.370.0100.00615.29
5.6.360.0120.00515.13
5.6.350.0120.00815.39
5.6.340.0140.00615.27
5.6.330.0100.00815.31
5.6.320.0110.00615.33
5.6.310.0110.00715.25
5.6.300.0070.01015.22
5.6.290.0130.00515.36
5.6.280.0100.00715.32
5.6.270.0110.00615.25
5.6.260.0090.00715.29
5.6.250.0130.00415.22
5.6.240.0090.00815.25
5.6.230.0090.00815.29
5.6.220.0130.00515.37
5.6.210.0090.01416.34
5.6.200.0110.02316.04
5.6.190.0060.02315.97
5.6.180.0070.01715.98
5.6.170.0100.01815.94
5.6.160.0120.02116.02
5.6.150.0100.02316.03
5.6.140.0110.01615.85
5.6.130.0080.01815.86
5.6.120.0110.02215.93
5.6.110.0120.01415.88
5.6.100.0130.02115.86
5.6.90.0110.02215.87
5.6.80.0080.01615.70
5.6.70.0110.01815.81
5.6.60.0100.02115.69
5.6.50.0120.01615.74
5.6.40.0080.02215.73
5.6.30.0100.02015.76
5.6.20.0080.02215.66
5.6.10.0100.01915.65
5.6.00.0100.01715.68
5.5.380.0110.00815.32
5.5.370.0090.00915.21
5.5.360.0140.00615.15
5.5.350.0090.02316.15
5.5.340.0130.02015.67
5.5.330.0120.02015.70
5.5.320.0120.01115.69
5.5.310.0100.01515.71
5.5.300.0080.01915.71
5.5.290.0120.01715.68
5.5.280.0110.01715.74
5.5.270.0100.02515.79
5.5.260.0090.02415.73
5.5.250.0110.02115.69
5.5.240.0110.02015.67
5.5.230.0080.02315.67
5.5.220.0100.02015.74
5.5.210.0070.02015.75
5.5.200.0090.01615.57
5.5.190.0100.01615.55
5.5.180.0110.01815.57
5.5.170.0130.00515.05
5.5.160.0130.01815.42
5.5.150.0090.01915.47
5.5.140.0090.01715.43
5.5.130.0120.01715.49
5.5.120.0080.02115.46
5.5.110.0080.01715.35
5.5.100.0100.01715.57
5.5.90.0100.02015.60
5.5.80.0090.02215.55
5.5.70.0100.01515.61
5.5.60.0080.01515.60
5.5.50.0090.01515.52
5.5.40.0070.01715.59
5.5.30.0110.01815.59
5.5.20.0080.02015.61
5.5.10.0080.01515.56
5.5.00.0120.02015.57
5.4.450.0080.01713.58
5.4.440.0100.01513.61
5.4.430.0080.02013.57
5.4.420.0090.01313.56
5.4.410.0080.01913.51
5.4.400.0070.02013.41
5.4.390.0080.01513.31
5.4.380.0090.01813.41
5.4.370.0090.01813.43
5.4.360.0090.02113.40
5.4.350.0060.01613.41
5.4.340.0070.02213.39
5.4.330.0080.00611.91
5.4.320.0090.01813.44
5.4.310.0080.01913.46
5.4.300.0080.01313.45
5.4.290.0110.01713.51
5.4.280.0090.01813.48
5.4.270.0090.01913.51
5.4.260.0060.01513.41
5.4.250.0070.01713.42
5.4.240.0080.02013.39
5.4.230.0100.01813.29
5.4.220.0080.01813.34
5.4.210.0040.01413.33
5.4.200.0090.01113.35
5.4.190.0100.01813.30
5.4.180.0090.01913.37
5.4.170.0100.01613.40
5.4.160.0070.02213.32
5.4.150.0090.01513.32
5.4.140.0080.01812.85
5.4.130.0100.01712.89
5.4.120.0040.01912.86
5.4.110.0090.01212.86
5.4.100.0090.01712.92
5.4.90.0080.02012.85
5.4.80.0090.01912.97
5.4.70.0080.01912.92
5.4.60.0070.01712.90
5.4.50.0080.01212.81
5.4.40.0100.01812.84
5.4.30.0070.01912.93
5.4.20.0090.01812.89
5.4.10.0120.01612.86
5.4.00.0060.02012.68
5.3.290.0100.02012.87
5.3.280.0050.01912.59
5.3.270.0110.01912.71
5.3.260.0070.01712.77
5.3.250.0080.01512.70
5.3.240.0100.01712.58
5.3.230.0080.02112.58
5.3.220.0100.02012.69
5.3.210.0080.01412.61
5.3.200.0110.01012.60
5.3.190.0070.01512.69
5.3.180.0080.02112.76
5.3.170.0050.01812.72
5.3.160.0070.02012.81
5.3.150.0070.01712.64
5.3.140.0060.02212.73
5.3.130.0090.02112.67
5.3.120.0080.02112.69
5.3.110.0100.01812.70
5.3.100.0050.02312.61
5.3.90.0090.01812.63
5.3.80.0050.01612.52
5.3.70.0070.01312.58
5.3.60.0050.01412.53
5.3.50.0080.02012.43
5.3.40.0060.01512.49
5.3.30.0090.01112.51
5.3.20.0060.01412.46
5.3.10.0080.01412.34
5.3.00.0070.01912.29

preferences:
61.1 ms | 400 KiB | 5 Q