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(); } class Answer implements AnswerInterface{ private $answer; public function get(){ $this->answer = 2; return $this; } public function the(){ $this->answer = $this->answer + 2; return $this; } public function answer(){ return $this->answer; } } $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.4.20.0100.00717.91
8.4.10.0000.01117.45
8.3.140.0070.01416.62
8.3.130.0040.00416.85
8.3.120.0150.00419.01
8.3.110.0030.00520.94
8.3.100.0090.00018.46
8.3.90.0040.00426.77
8.3.80.0040.00419.36
8.3.70.0070.00716.71
8.3.60.0140.00418.30
8.3.50.0070.01523.00
8.3.40.0060.00918.68
8.3.30.0030.01018.83
8.3.20.0070.00721.87
8.3.10.0040.00421.95
8.3.00.0080.00022.10
8.2.260.0040.00416.54
8.2.250.0030.00616.81
8.2.240.0100.00019.13
8.2.230.0100.00622.58
8.2.220.0060.01224.06
8.2.210.0080.00026.77
8.2.200.0090.00018.88
8.2.190.0080.00818.14
8.2.180.0170.00316.38
8.2.170.0100.00322.96
8.2.160.0100.00322.12
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0080.00017.96
8.2.120.0040.00426.35
8.2.110.0000.00820.35
8.2.100.0040.00817.72
8.2.90.0050.00319.27
8.2.80.0040.00417.97
8.2.70.0080.00017.50
8.2.60.0000.00817.93
8.2.50.0040.00418.10
8.2.40.0040.00420.47
8.2.30.0000.00819.30
8.2.20.0060.00318.12
8.2.10.0050.00217.93
8.2.00.0030.00617.56
8.1.310.0080.00018.47
8.1.300.0060.00316.13
8.1.290.0050.00530.84
8.1.280.0120.00925.92
8.1.270.0030.00523.79
8.1.260.0000.00726.35
8.1.250.0100.01028.09
8.1.240.0090.00021.25
8.1.230.0000.01117.72
8.1.220.0080.00017.74
8.1.210.0000.00918.77
8.1.200.0060.00317.38
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0040.00418.66
8.1.160.0050.00218.83
8.1.150.0040.00420.30
8.1.140.0080.00019.63
8.1.130.0030.00318.98
8.1.120.0000.00717.46
8.1.110.0040.00417.50
8.1.100.0040.00417.46
8.1.90.0030.00717.46
8.1.80.0030.00517.43
8.1.70.0040.00417.44
8.1.60.0040.00417.51
8.1.50.0080.00017.57
8.1.40.0040.00417.47
8.1.30.0000.00717.62
8.1.20.0050.00317.64
8.1.10.0030.00517.59
8.1.00.0030.00617.51
8.0.300.0050.00318.77
8.0.290.0000.00816.63
8.0.280.0040.00418.32
8.0.270.0000.00716.93
8.0.260.0050.00317.25
8.0.250.0030.00317.04
8.0.240.0000.00816.99
8.0.230.0030.00317.05
8.0.220.0000.00716.84
8.0.210.0030.00316.89
8.0.200.0060.00016.89
8.0.190.0050.00217.07
8.0.180.0040.00416.95
8.0.170.0000.00717.01
8.0.160.0030.00317.04
8.0.150.0030.00316.86
8.0.140.0040.00416.88
8.0.130.0050.00013.42
8.0.120.0050.00316.92
8.0.110.0000.00816.75
8.0.100.0050.00216.78
8.0.90.0070.00016.77
8.0.80.0030.01316.89
8.0.70.0040.00416.84
8.0.60.0040.00416.85
8.0.50.0000.00716.80
8.0.30.0070.01117.06
8.0.20.0100.01117.40
8.0.10.0000.00817.04
8.0.00.0170.00016.95
7.4.330.0000.00515.55
7.4.320.0030.00316.61
7.4.300.0000.00716.59
7.4.290.0060.00316.52
7.4.280.0000.00716.64
7.4.270.0070.00016.57
7.4.260.0000.00716.48
7.4.250.0000.00716.54
7.4.240.0030.00316.51
7.4.230.0030.00316.71
7.4.220.0070.01116.63
7.4.210.0070.01116.59
7.4.200.0000.00716.61
7.4.160.0060.01016.49
7.4.150.0070.01017.40
7.4.140.0060.01117.86
7.4.130.0080.00916.56
7.4.120.0110.00816.54
7.4.110.0030.01416.73
7.4.100.0110.00816.51
7.4.90.0140.00316.54
7.4.80.0060.01019.39
7.4.70.0120.00416.48
7.4.60.0070.01016.45
7.4.50.0100.00616.44
7.4.40.0030.01316.63
7.4.30.0160.00916.49
7.4.00.0060.00915.12
7.3.330.0050.00013.43
7.3.320.0050.00013.23
7.3.310.0000.00816.39
7.3.300.0000.00716.38
7.3.290.0030.00316.24
7.3.280.0070.01116.44
7.3.270.0090.00817.40
7.3.260.0130.00916.52
7.3.250.0120.00816.54
7.3.240.0130.00416.40
7.3.230.0140.00716.41
7.3.210.0060.01116.54
7.3.200.0140.00316.47
7.3.190.0070.01016.38
7.3.180.0090.00616.62
7.3.170.0090.00616.51
7.3.160.0070.01016.35
7.2.330.0110.00716.59
7.2.320.0060.01216.69
7.2.310.0100.00716.80
7.2.300.0120.00616.79
7.2.290.0100.00716.86
7.2.60.0040.00816.79
7.1.200.0100.00315.67
7.1.70.0070.00017.16
7.1.60.0080.00417.32
7.1.50.0030.01316.85
7.1.10.0070.06322.08
7.1.00.0100.07722.39
7.0.200.0000.01416.79
7.0.150.0100.05721.80
7.0.140.0070.05721.89
7.0.130.0030.08321.91
7.0.120.0130.05721.88
7.0.110.0030.06021.87
7.0.100.0030.06021.85
7.0.90.0070.05721.94
7.0.80.0070.05321.94
7.0.70.0100.05322.02
7.0.60.0130.05021.89
7.0.50.0030.06021.85
7.0.40.0030.06022.00
7.0.30.0100.06721.93
7.0.20.0130.06021.94
7.0.10.0100.05321.89
7.0.00.0100.05721.93

preferences:
53.97 ms | 403 KiB | 5 Q