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; } } } 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; } } 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.00718.43
8.3.50.0140.00319.89
8.3.40.0070.00718.66
8.3.30.0070.01318.88
8.3.20.0040.00423.59
8.3.10.0040.00421.96
8.3.00.0090.00021.94
8.2.180.0140.00718.54
8.2.170.0040.01122.96
8.2.160.0000.01422.13
8.2.150.0140.00425.66
8.2.140.0060.00324.66
8.2.130.0040.00417.89
8.2.120.0050.00326.35
8.2.110.0090.00021.00
8.2.100.0050.00517.91
8.2.90.0030.00519.28
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0060.00317.80
8.2.50.0060.00318.10
8.2.40.0040.00420.51
8.2.30.0000.00819.13
8.2.20.0000.00918.00
8.2.10.0040.00417.93
8.2.00.0070.00017.66
8.1.280.0140.00725.92
8.1.270.0040.00423.96
8.1.260.0000.00826.35
8.1.250.0090.00028.09
8.1.240.0060.00323.96
8.1.230.0030.00717.77
8.1.220.0080.00017.76
8.1.210.0000.00818.77
8.1.200.0030.00617.47
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0080.00018.59
8.1.160.0070.00018.89
8.1.150.0030.00621.96
8.1.140.0040.00419.64
8.1.130.0030.00319.00
8.1.120.0040.00417.45
8.1.110.0030.00517.47
8.1.100.0000.00717.38
8.1.90.0050.00317.38
8.1.80.0040.00317.46
8.1.70.0070.00017.45
8.1.60.0040.00417.61
8.1.50.0030.00517.43
8.1.40.0000.00817.40
8.1.30.0000.00717.60
8.1.20.0040.00417.51
8.1.10.0050.00317.52
8.1.00.0030.00617.51
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.56
8.0.270.0000.00816.93
8.0.260.0000.00817.17
8.0.250.0030.00317.05
8.0.240.0000.00816.96
8.0.230.0000.00716.95
8.0.220.0060.00316.97
8.0.210.0060.00016.94
8.0.200.0030.00317.00
8.0.190.0030.00316.95
8.0.180.0000.00717.00
8.0.170.0070.00016.98
8.0.160.0030.00317.05
8.0.150.0000.00716.83
8.0.140.0000.00716.95
8.0.130.0000.00513.26
8.0.120.0040.00416.98
8.0.110.0000.00816.82
8.0.100.0030.00516.84
8.0.90.0080.00016.89
8.0.80.0040.01216.88
8.0.70.0050.00316.90
8.0.60.0050.00216.86
8.0.50.0080.00016.87
8.0.30.0100.00617.00
8.0.20.0060.01317.40
8.0.10.0070.00017.03
8.0.00.0100.00716.81
7.4.330.0030.00315.55
7.4.320.0000.00716.52
7.4.300.0030.00316.61
7.4.290.0030.00616.59
7.4.280.0030.00616.61
7.4.270.0000.00716.53
7.4.260.0040.00416.49
7.4.250.0050.00216.57
7.4.240.0030.00316.47
7.4.230.0000.00716.39
7.4.220.0170.00716.53
7.4.210.0060.01016.54
7.4.200.0040.00416.61
7.4.160.0090.01116.48
7.4.150.0140.00317.40
7.4.140.0080.01417.86
7.4.130.0120.00516.59
7.4.120.0140.00616.63
7.4.110.0110.00716.46
7.4.100.0090.00916.39
7.4.90.0100.00716.36
7.4.80.0040.01319.39
7.4.70.0110.00616.59
7.4.60.0050.01116.48
7.4.50.0090.00416.41
7.4.40.0120.00916.39
7.4.30.0110.01116.64
7.4.00.0030.01014.88
7.3.330.0000.00513.43
7.3.320.0000.00613.49
7.3.310.0030.00616.27
7.3.300.0070.00016.43
7.3.290.0000.00616.42
7.3.280.0070.01016.44
7.3.270.0090.00917.40
7.3.260.0120.00616.50
7.3.250.0110.01016.38
7.3.240.0130.00516.54
7.3.230.0100.00616.41
7.3.210.0090.00816.44
7.3.200.0090.00916.41
7.3.190.0090.01216.52
7.3.180.0100.00716.46
7.3.170.0140.00316.48
7.3.160.0100.00716.50
7.3.10.0030.01016.46
7.3.00.0110.00416.64
7.2.330.0000.01916.71
7.2.320.0080.00816.79
7.2.310.0140.00716.77
7.2.300.0100.01416.54
7.2.290.0060.01216.40
7.2.130.0090.00916.95
7.2.120.0100.00717.07
7.2.110.0090.00617.00
7.2.100.0070.00716.98
7.2.90.0000.01617.05
7.2.80.0040.01116.97
7.2.70.0100.00617.15
7.2.60.0050.00816.95
7.2.50.0080.00416.87
7.2.40.0060.00616.95
7.2.30.0000.01516.99
7.2.20.0060.00917.06
7.2.10.0070.00416.92
7.2.00.0030.00717.01
7.1.250.0100.00316.01
7.1.200.0060.00615.45
7.1.70.0020.00516.86
7.1.60.0000.01117.12
7.1.50.0060.01516.97
7.1.10.0130.05722.14
7.1.00.0200.06322.39
7.0.200.0090.00016.68
7.0.150.0130.06321.86
7.0.140.0100.05321.88
7.0.130.0070.06321.92
7.0.120.0070.06021.92
7.0.110.0030.06021.80
7.0.100.0030.06021.92
7.0.90.0070.05721.93
7.0.80.0130.04721.89
7.0.70.0130.04721.86
7.0.60.0130.04721.89
7.0.50.0000.06021.94
7.0.40.0100.05021.93
7.0.30.0100.05021.93
7.0.20.0130.05021.92
7.0.10.0030.06321.82
7.0.00.0000.06321.86

preferences:
59.81 ms | 400 KiB | 5 Q