3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Page { private $pageReader; public function __construct(PageReader $pageReader) { $this->pageReader = $pageReader; } public function show($params) { $data['content'] = $this->pageReader->readBySlug($slug); } } interface PageReader { public function readBySlug(string $slug) : string; } class FilePageReader implements PageReader { private $pageFolder; public function __construct(string $pageFolder) { $this->pageFolder = $pageFolder; } public function readBySlug(string $slug) : string { $path = "$this->pageFolder/$slug.md"; if (!file_exists($path)) { throw new Exception($slug); } return file_get_contents($path); } }

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.5.30.0110.00719.51
8.5.20.0120.00518.63
8.5.10.0080.00916.59
8.5.00.0130.00819.92
8.4.180.0140.01225.68
8.4.170.0120.00923.84
8.4.160.0120.01023.90
8.4.150.0070.00517.63
8.4.140.0150.00817.48
8.4.130.0060.00617.59
8.4.120.0110.01020.53
8.4.110.0050.00422.39
8.4.100.0100.01017.55
8.4.90.0060.00420.50
8.4.80.0110.00818.83
8.4.70.0120.00819.14
8.4.60.0100.00818.73
8.4.50.0100.01018.93
8.4.40.0190.00319.27
8.4.30.0030.00517.27
8.4.20.0000.00917.55
8.4.10.0080.01219.48
8.3.300.0140.00620.89
8.3.290.0120.00920.60
8.3.280.0120.00818.48
8.3.270.0080.01316.45
8.3.260.0050.00416.50
8.3.250.0090.00918.91
8.3.240.0120.00816.40
8.3.230.0130.00616.57
8.3.220.0130.00519.13
8.3.210.0150.00318.26
8.3.200.0050.00416.60
8.3.190.0030.00517.06
8.3.180.0030.00616.68
8.3.170.0120.00620.74
8.3.160.0040.00417.18
8.3.150.0050.00217.22
8.3.140.0150.00316.77
8.3.130.0100.00016.46
8.3.120.0110.00019.11
8.3.110.0030.01018.44
8.3.100.0080.00018.29
8.3.90.0060.01326.77
8.3.80.0030.00618.43
8.3.70.0070.00716.58
8.3.60.0150.00618.30
8.3.50.0110.00817.33
8.3.40.0000.01518.84
8.3.30.0070.00718.59
8.3.20.0040.00420.19
8.3.10.0080.00020.79
8.3.00.0040.00420.89
8.2.300.0110.01018.68
8.2.290.0130.00316.73
8.2.280.0080.00718.63
8.2.270.0040.01518.78
8.2.260.0070.01016.44
8.2.250.0040.00417.28
8.2.240.0060.00317.25
8.2.230.0080.00020.94
8.2.220.0040.00424.06
8.2.210.0080.00026.77
8.2.200.0060.00316.50
8.2.190.0090.01216.63
8.2.180.0070.00716.32
8.2.170.0140.00318.96
8.2.160.0090.00622.96
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00819.70
8.2.120.0040.00426.35
8.2.110.0090.00022.23
8.2.100.0040.00817.72
8.2.90.0090.00019.09
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0040.00417.79
8.2.50.0050.00318.10
8.2.40.0040.00422.32
8.2.30.0080.00019.07
8.2.20.0040.00418.07
8.2.10.0070.00017.88
8.2.00.0040.00418.02
8.1.340.0040.01319.56
8.1.330.0160.00416.53
8.1.320.0100.00915.92
8.1.310.0000.00816.71
8.1.300.0090.00017.75
8.1.290.0090.00030.84
8.1.280.0130.00725.92
8.1.270.0040.00422.08
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00020.84
8.1.230.0100.00019.09
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0040.00417.13
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0000.00918.71
8.1.160.0000.00818.93
8.1.150.0000.00718.78
8.1.140.0000.00819.44
8.1.130.0000.00817.45
8.1.120.0000.00717.44
8.1.110.0030.00617.41
8.1.100.0030.00317.39
8.1.90.0000.00817.43
8.1.80.0070.00017.46
8.1.70.0050.00317.31
8.1.60.0050.00217.57
8.1.50.0080.00017.40
8.1.40.0100.00017.42
8.1.30.0000.00817.54
8.1.20.0050.00317.59
8.1.10.0040.00417.36
8.1.00.0030.00517.35
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0040.00418.31
8.0.270.0030.00317.20
8.0.260.0060.00016.68
8.0.250.0040.00416.93
8.0.240.0000.00816.90
8.0.230.0000.00716.89
8.0.220.0060.00016.71
8.0.210.0000.00716.89
8.0.200.0030.00316.89
8.0.190.0030.00516.79
8.0.180.0040.00416.76
8.0.170.0000.00716.93
8.0.160.0030.00316.87
8.0.150.0000.00716.91
8.0.140.0040.00416.73
8.0.130.0030.00313.27
8.0.120.0000.00716.84
8.0.110.0050.00316.75
8.0.100.0000.00816.70
8.0.90.0040.00416.86
8.0.80.0100.01016.78
8.0.70.0040.00416.86
8.0.60.0000.00816.71
8.0.50.0000.00716.83
8.0.30.0090.01116.97
8.0.20.0080.01017.40
8.0.10.0000.00817.02
8.0.00.0070.01116.88
7.4.330.0050.00015.55
7.4.320.0050.00216.53
7.4.300.0000.00616.45
7.4.290.0070.00016.46
7.4.280.0040.00416.59
7.4.270.0030.00316.54
7.4.260.0040.00416.55
7.4.250.0000.00716.37
7.4.240.0030.00316.48
7.4.230.0000.00716.45
7.4.220.0130.01316.54
7.4.210.0070.01016.51
7.4.200.0000.00716.45
7.4.160.0030.01216.49
7.4.150.0080.00817.40
7.4.140.0100.00717.86
7.4.130.0100.01416.29
7.4.120.0080.01116.41
7.4.110.0100.01016.25
7.4.100.0110.01516.30
7.4.90.0090.00916.62
7.4.80.0120.00419.39
7.4.70.0140.00316.46
7.4.60.0130.00316.70
7.4.50.0060.00916.30
7.4.40.0110.00716.36
7.4.30.0090.00716.30
7.4.00.0000.01415.12
7.3.330.0050.00013.19
7.3.320.0030.00313.05
7.3.310.0000.00716.29
7.3.300.0060.00016.06
7.3.290.0070.00016.24
7.3.280.0090.00716.18
7.3.270.0070.01117.40
7.3.260.0120.00716.41
7.3.250.0140.00516.14
7.3.240.0080.01016.40
7.3.230.0160.00616.30
7.3.210.0100.00616.42
7.3.200.0070.01016.27
7.3.190.0080.00816.14
7.3.180.0070.01416.46
7.3.170.0100.00916.14
7.3.160.0070.01016.42
7.2.330.0100.01016.29
7.2.320.0090.00816.23
7.2.310.0120.00616.34
7.2.300.0170.00016.29
7.2.290.0110.00816.23
7.2.60.0100.00716.89
7.2.50.0070.01016.72
7.1.200.0030.00615.45
7.1.70.1190.00815.36
7.1.60.0240.01533.25
7.1.50.1450.01632.84
7.1.40.1400.02232.39
7.1.30.0300.01032.71
7.1.20.1550.00832.80
7.1.10.1450.01014.57
7.1.00.0080.01214.93
7.0.200.1270.00814.84
7.0.190.0020.01814.78
7.0.180.0050.02114.08
7.0.170.0060.01614.15
7.0.160.1340.00914.27
7.0.150.0140.00914.30
7.0.140.0060.01714.42
7.0.130.1110.01214.36
7.0.120.1130.01814.74
7.0.110.1260.01114.30
7.0.100.1410.00614.36
7.0.90.1050.00814.33
7.0.80.1050.00714.36
7.0.70.1040.01614.45
7.0.60.1190.01414.34
7.0.50.1180.01314.62
7.0.40.1170.01214.66
7.0.30.1140.01214.83
7.0.20.0930.01014.60
7.0.10.1010.01014.59
7.0.00.0830.01014.51

preferences:
65.03 ms | 1434 KiB | 5 Q