3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: application/json'); error_reporting(E_ALL); ini_set('display_errors', 1); class Mushroom { public $microdose = 0.25; public $regular = 2.5; public $heroic = 5.0; public $wetRatio = 9.3; public $wet = null; public $maoRatio = 2; public $mao = null; public $dosageFactor = null; public $strains = [ "azurenscens" => "1.78", "bohemica" => "1.34", "semilanceata" => ".98", "baeocystis" => ".85", "cyanescens" => ".85", "tampanensis" => ".68", "cubensis" => ".63", "weilii" => ".61", "hoogshagenii" => ".60", "stuntzii" => ".36", "cyanofibrillosa" => ".21", "liniformans" => ".16", "penis envy" => "1.35" ]; public function __construct() { ksort($this->strains, SORT_NATURAL | SORT_STRING); $this->wet = $_GET['wet'] ?? 0; $this->mao = $_GET['mao'] ?? 0; if ($this->wet && $this->mao) { $this->microdose = (($this->microdose * $this->wetRatio) / $this->maoRatio); $this->regular = (($this->regular * $this->wetRatio) / $this->maoRatio); $this->heroic = (($this->heroic * $this->wetRatio) / $this->maoRatio); } else if ($this->wet) { $this->microdose = $this->microdose * $this->wetRatio; $this->regular = $this->regular * $this->wetRatio; $this->heroic = $this->heroic * $this->wetRatio; } else if ($this->mao) { $this->microdose = $this->microdose / $this->maoRatio; $this->regular = $this->regular / $this->maoRatio; $this->heroic = $this->heroic / $this->maoRatio; } } public function getAll() { $dose = []; foreach ($this->strains as $strain => $potency) { $this->dosageFactor = $potency / $this->strains['cubensis']; $dose[$strain]['name'] = "Psilocybin " . ucfirst($strain); $dose[$strain]['microdose'] = round(($this->microdose / $this->dosageFactor), 2); $dose[$strain]['regular'] = round(($this->regular / $this->dosageFactor), 2); $dose[$strain]['heroic'] = round(($this->heroic / $this->dosageFactor), 2); } return $dose; } public function getMicrodose() { $dose = []; foreach ($this->strains as $strain => $potency) { $this->dosageFactor = $potency / $this->strains['cubensis']; $dose[$strain]['name'] = "Psilocybin " . ucfirst($strain); $dose[$strain]['microdose'] = round(($this->microdose / $this->dosageFactor), 2); } return $dose; } public function getRegular() { $dose = []; foreach ($this->strains as $strain => $potency) { $this->dosageFactor = $potency / $this->strains['cubensis']; $dose[$strain]['name'] = "Psilocybin " . ucfirst($strain); $dose[$strain]['regular'] = round(($this->microdose / $this->dosageFactor), 2); } return $dose; } public function getHeroic() { $dose = []; foreach ($this->strains as $strain => $potency) { $this->dosageFactor = $potency / $this->strains['cubensis']; $dose[$strain]['name'] = "Psilocybin " . ucfirst($strain); $dose[$strain]['heroic'] = round(($this->microdose / $this->dosageFactor), 2); } return $dose; } } $mushroom = new Mushroom(); echo json_encode($mushroom->getAll());

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.0110.00318.20
8.3.50.0040.01218.07
8.3.40.0040.01118.98
8.3.30.0110.00418.98
8.3.20.0060.00322.27
8.3.10.0040.00420.29
8.3.00.0040.00422.43
8.2.180.0090.00918.41
8.2.170.0140.00022.96
8.2.160.0140.00019.46
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.01219.10
8.2.110.0090.00320.66
8.2.100.0070.00417.84
8.2.90.0060.00317.97
8.2.80.0060.00318.05
8.2.70.0060.00318.17
8.2.60.0050.00318.22
8.2.50.0000.00818.10
8.2.40.0000.00819.61
8.2.30.0040.00419.35
8.2.20.0040.00418.13
8.2.10.0040.00419.41
8.2.00.0040.00419.41
8.1.280.0140.00325.92
8.1.270.0080.00022.63
8.1.260.0070.00726.35
8.1.250.0000.00828.09
8.1.240.0000.01119.26
8.1.230.0090.00322.85
8.1.220.0030.00617.88
8.1.210.0030.00518.77
8.1.200.0040.00717.35
8.1.190.0080.00017.35
8.1.180.0080.00418.10
8.1.170.0090.00018.68
8.1.160.0050.00519.01
8.1.150.0040.00418.91
8.1.140.0000.00820.91
8.1.130.0030.00320.19
8.1.120.0030.00717.50
8.1.110.0000.00817.52
8.1.100.0000.00817.46
8.1.90.0050.00317.55
8.1.80.0040.00417.47
8.1.70.0040.00417.47
8.1.60.0000.00917.70
8.1.50.0040.00417.59
8.1.40.0040.00417.46
8.1.30.0000.00817.77
8.1.20.0050.00317.72
8.1.10.0040.00417.67
8.1.00.0040.00817.69
8.0.300.0050.00321.49
8.0.290.0080.00017.00
8.0.280.0040.00418.60
8.0.270.0040.00417.28
8.0.260.0050.00320.18
8.0.250.0070.00016.95
8.0.240.0030.00317.09
8.0.230.0030.00317.06
8.0.220.0040.00416.95
8.0.210.0040.00416.91
8.0.200.0070.00017.07
8.0.190.0000.00817.07
8.0.180.0000.00716.98
8.0.170.0040.00417.09
8.0.160.0040.00417.03
8.0.150.0020.00516.84
8.0.140.0000.00716.95
8.0.130.0000.00513.46
8.0.120.0000.00816.94
8.0.110.0000.00816.98
8.0.100.0050.00316.83
8.0.90.0090.00016.88
8.0.80.0090.00616.98
8.0.70.0030.00517.07
8.0.60.0000.00816.85
8.0.50.0000.00716.88
8.0.30.0110.00817.12
8.0.20.0060.01217.18
8.0.10.0000.00816.93
8.0.00.0070.01116.66
7.4.330.0000.00515.55
7.4.320.0040.00416.72
7.4.300.0030.00316.47
7.4.290.0000.00716.69
7.4.280.0040.00416.63
7.4.270.0000.00716.66
7.4.260.0060.00013.41
7.4.250.0000.00716.70
7.4.240.0040.00416.54
7.4.230.0030.00516.60
7.4.220.0040.00316.59
7.4.210.0080.00716.74
7.4.200.0000.00716.69
7.4.130.0090.00916.69
7.4.120.0100.01016.77
7.4.110.0170.00016.54
7.4.100.0170.00016.75
7.4.90.0100.00716.41
7.4.80.0060.01019.39
7.4.70.0170.00716.63
7.4.60.0090.00916.61
7.4.50.0070.00716.51
7.4.40.0090.00816.40
7.4.00.0060.01014.90
7.3.330.0000.00716.55
7.3.320.0030.00313.55
7.3.310.0050.00216.27
7.3.300.0000.00716.43
7.3.290.0040.01116.55
7.3.260.0100.00816.49
7.3.240.0100.00916.47
7.3.230.0130.00316.75
7.3.210.0130.00416.45
7.3.200.0120.00616.59
7.3.190.0080.00816.35
7.3.180.0100.00716.52
7.3.170.0100.00616.38
7.3.160.0090.00616.28
7.3.90.0030.01614.64
7.3.80.0070.00714.58
7.3.70.0150.00314.75
7.3.60.0100.03214.78
7.3.50.0060.00914.86
7.3.40.0040.01515.00
7.3.30.0070.00714.92
7.3.20.0040.01114.66
7.3.10.0110.00414.66
7.3.00.0110.00414.87
7.2.330.0100.00716.74
7.2.320.0070.01016.98
7.2.310.0110.00516.79
7.2.300.0150.00316.77
7.2.290.0060.01216.96
7.2.220.0090.01215.20
7.2.210.0030.01315.29
7.2.200.0110.00314.94
7.2.190.0060.01314.92
7.2.180.0000.01514.99
7.2.170.0090.00614.86
7.2.160.0030.01014.98
7.2.150.0070.01015.35
7.2.140.0090.00615.09
7.2.130.0110.00414.88
7.2.120.0070.01015.05
7.2.110.0140.00415.18
7.2.100.0030.01315.23
7.2.90.0060.01115.27
7.2.80.0130.00615.16
7.2.70.0080.01115.09
7.2.60.0090.01214.97
7.2.50.0130.00715.21
7.2.40.0160.00015.37
7.2.30.0090.00915.02
7.2.20.0110.00615.18
7.2.10.0080.00815.14
7.2.00.0070.01015.23
7.1.320.0150.00614.12
7.1.310.0130.00613.84
7.1.300.0120.00313.89
7.1.290.0140.00713.94
7.1.280.0160.01213.86
7.1.270.0110.00413.89
7.1.260.0090.00614.20
7.1.250.0110.00313.81

preferences:
64.59 ms | 400 KiB | 5 Q