3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Language: int { case English = 1; case Spanish = 2; public static function fromName(string $name): Language { return (new \ReflectionEnum(static::class))->getCase($name)->getValue(); } } $english = Language::from(1); $spanish = Language::from(2); $english = Language::fromName('English'); $spanish = Language::fromName('Spanish'); var_dump([ 'name' => $english->name, 'value' => $english->value, ]); // this will result in an error: Language::fromName('Arabic');

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.10.0110.00720.15
8.5.00.0140.01020.18
8.4.160.0120.01123.95
8.4.150.0020.00114.05
8.4.140.0130.00817.78
8.4.130.0060.00617.68
8.4.120.0110.00920.41
8.4.110.0100.01024.40
8.4.100.0120.00917.89
8.4.90.0070.00517.74
8.4.80.0140.00618.03
8.4.70.0130.01218.02
8.4.60.0120.00918.70
8.4.50.0130.00717.93
8.4.40.0150.00619.63
8.4.30.0160.00320.55
8.4.20.0140.00719.60
8.4.10.0060.00320.44
8.3.280.0100.01018.64
8.3.270.0140.00716.52
8.3.260.0090.01016.80
8.3.250.0150.00419.04
8.3.240.0080.00716.88
8.3.230.0030.00516.70
8.3.220.0060.00517.11
8.3.210.0080.00716.93
8.3.200.0050.00416.84
8.3.190.0060.00216.86
8.3.180.0130.00620.77
8.3.170.0180.00016.62
8.3.160.0060.01316.57
8.3.150.0110.00717.36
8.3.140.0080.00017.34
8.3.130.0000.00818.38
8.3.120.0070.00316.54
8.3.110.0050.00322.58
8.3.100.0050.00322.58
8.3.90.0110.00722.58
8.3.50.0000.00822.58
8.2.290.0040.00620.68
8.2.280.0060.00318.54
8.2.270.0130.00616.64
8.2.260.0080.00018.84
8.2.250.0080.00016.57
8.2.240.0090.00919.00
8.2.230.0030.00622.58
8.2.220.0070.01022.58
8.2.210.0000.00922.58
8.1.330.0100.00816.63
8.1.320.0050.00516.51
8.1.310.0050.00318.34
8.1.300.0030.00617.96
8.1.30.0060.00317.66

preferences:
74.9 ms | 403 KiB | 5 Q