3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Cookpedia; class Entry { private $data = [ 'id' => 0, 'title' => null, 'latin_title' => null, 'category' => 0, 'calories' => 0, 'proteins' => 0, 'fats' => 0, 'carbohydrates' => 0, 'description' => null, 'tags' => null, 'measures' => [], ]; public function hydrate(PDO $dbh, int $id): void { $stmt = $dbh->prepare("SELECT `title`, `latin_title`, `category`, `calories`, `proteins`, `fats`, `carbohydrates`, `description`, `measures`, `tags` FROM `cook_encyclopedia_entries` WHERE `id`=:id"); $result = $stmt->execute($id); $this->data = $result->fetch(PDO::FETCH_ASSOC); } public function getData(): array { return $this->data; } public function getMeasures(): array { $measures = explode('|',$this->data['measures']); return [ 'g_in_tsp' => $measures[0], 'g_in_tbsp' => $measures[1], 'g_in_glass' => $measures[2], 'g_in_cup' => $measures[3], ]; } }

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.0090.00618.30
8.3.50.0150.00218.07
8.3.40.0080.00818.69
8.3.30.0070.00718.67
8.3.20.0000.00721.85
8.3.10.0080.00018.88
8.3.00.0070.00021.77
8.2.180.0120.00318.11
8.2.170.0090.00622.96
8.2.160.0070.00722.18
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0000.00920.29
8.2.100.0110.00017.72
8.2.90.0030.00517.50
8.2.80.0070.00318.51
8.2.70.0040.00417.50
8.2.60.0030.00517.50
8.2.50.0040.00417.55
8.2.40.0040.00417.62
8.2.30.0000.00720.46
8.2.20.0040.00417.96
8.2.10.0060.00318.78
8.2.00.0050.00219.59
8.1.280.0070.01525.92
8.1.270.0000.00820.63
8.1.260.0080.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00023.73
8.1.230.0120.00020.88
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0000.00817.23
8.1.190.0040.00417.29
8.1.180.0050.00318.10
8.1.170.0000.00719.03
8.1.160.0050.00318.70
8.1.150.0020.00518.83
8.1.140.0040.00420.19
8.1.130.0000.00720.17
8.1.120.0000.00717.39
8.1.110.0030.00517.31
8.1.100.0040.00417.25
8.1.90.0000.00817.37
8.1.80.0080.00017.37
8.1.70.0040.00417.24
8.1.60.0000.00817.41
8.1.50.0000.00817.40
8.1.40.0050.00317.41
8.1.30.0030.00617.53
8.1.20.0040.00417.53
8.1.10.0040.00417.45
8.1.00.0040.00417.19
8.0.300.0000.00719.73
8.0.290.0050.00316.58
8.0.280.0000.00718.23
8.0.270.0050.00217.17
8.0.260.0090.00018.36
8.0.250.0000.00716.86
8.0.240.0060.00016.90
8.0.230.0040.00416.77
8.0.220.0030.00316.84
8.0.210.0040.00416.68
8.0.200.0000.00716.84
8.0.190.0030.00516.77
8.0.180.0070.00016.85
8.0.170.0050.00316.82
8.0.160.0040.00416.79
8.0.150.0030.00616.66
8.0.140.0000.00716.81
8.0.130.0000.00613.21
8.0.120.0000.00716.71
8.0.110.0000.00716.67
8.0.100.0050.00216.91
8.0.90.0070.00016.79
8.0.80.0060.00916.80
8.0.70.0000.00716.69
8.0.60.0000.00716.69
8.0.50.0040.00416.59
8.0.30.0160.00316.98
8.0.20.0110.00817.05
8.0.10.0000.00816.95
8.0.00.0090.01016.69
7.4.330.0000.00515.55
7.4.320.0000.00816.39
7.4.300.0030.00316.30
7.4.290.0070.00016.41
7.4.280.0000.00816.47
7.4.270.0040.00416.41
7.4.260.0070.00016.46
7.4.250.0030.00316.32
7.4.240.0000.00716.48
7.4.230.0000.00716.24
7.4.220.0050.00316.43
7.4.210.0050.01216.50
7.4.200.0040.00416.22
7.4.140.0120.00817.86
7.4.130.0110.00716.25
7.4.120.0070.01016.32
7.4.110.0150.00916.45
7.4.100.0120.00616.49
7.4.90.0090.00916.35
7.4.80.0160.00619.39
7.4.70.0080.01216.32
7.4.60.0060.01016.35
7.4.50.0120.00316.50
7.4.40.0070.01016.45
7.4.10.0040.01414.67
7.4.00.0090.00714.76
7.3.330.0020.00213.27
7.3.320.0030.00313.16
7.3.310.0040.00415.96
7.3.300.0000.00716.08
7.3.290.0000.01416.19
7.3.280.0100.00616.08
7.3.260.0110.01016.33
7.3.240.0050.01116.34
7.3.230.0100.00716.18
7.3.210.0100.00716.52
7.3.200.0100.00716.27
7.3.190.0110.01116.52
7.3.180.0130.01016.29
7.3.170.0160.00016.25
7.3.160.0060.01016.39
7.3.130.0130.00614.64
7.3.120.0070.01114.40
7.3.110.0060.00614.66
7.3.100.0040.00714.71
7.3.90.0070.00314.52
7.3.80.0070.01014.95
7.3.70.0090.00614.38
7.3.60.0040.01214.69
7.3.50.0050.00714.59
7.3.40.0070.00614.65
7.3.30.0050.01014.59
7.3.20.0130.00515.47
7.3.10.0100.00815.73
7.3.00.0090.00515.47
7.2.330.0090.00916.29
7.2.320.0140.00716.30
7.2.310.0140.00416.49
7.2.300.0100.00616.33
7.2.290.0080.01116.38
7.2.260.0030.01514.88
7.2.250.0120.00714.69
7.2.240.0060.01014.80
7.2.230.0130.00314.51
7.2.220.0090.00614.81
7.2.210.0100.00714.43
7.2.200.0060.00914.30
7.2.190.0070.00714.68
7.2.180.0050.00814.86
7.2.170.0030.00914.88
7.2.160.0070.00314.83
7.2.150.0100.00315.52
7.2.140.0070.00815.73
7.2.130.0080.01315.77
7.2.120.0070.00915.76
7.2.110.0110.00315.82
7.2.100.0150.00315.74
7.2.90.0070.00515.82
7.2.80.0060.00915.71
7.2.70.0080.00515.88
7.2.60.0080.01015.76
7.2.50.0040.01015.90
7.2.40.0060.00815.90
7.2.30.0110.00715.69
7.2.20.0130.00415.63
7.2.10.0500.00315.72
7.2.00.0020.01115.84
7.1.330.0030.01015.63
7.1.320.0100.00715.76
7.1.310.0070.01015.59
7.1.300.0030.00915.34
7.1.290.0000.00815.50
7.1.280.0070.00714.63
7.1.270.0110.00314.67
7.1.260.0030.01514.52
7.1.250.0130.00714.74
7.1.240.0060.00615.56
7.1.230.0000.01115.58
7.1.220.0040.00415.66
7.1.210.0030.01215.66
7.1.200.0100.00615.45
7.1.190.0000.01415.51
7.1.180.0030.00615.09
7.1.170.0060.00915.51
7.1.160.0030.01215.77
7.1.150.0060.00315.75
7.1.140.0070.00715.64
7.1.130.0030.00715.61
7.1.120.0100.00715.79
7.1.110.0060.00615.70
7.1.100.0070.00715.66
7.1.90.0000.01415.70
7.1.80.0030.01015.67
7.1.70.0060.00915.41
7.1.60.0070.00415.66
7.1.50.0070.00715.63
7.1.40.0060.00615.30
7.1.30.0090.00315.48
7.1.20.0080.00415.29
7.1.10.0060.00615.59
7.1.00.0040.01315.55

preferences:
60.28 ms | 401 KiB | 5 Q