3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* class ReflectionEnum { public function __construct(string $name); public function getCases(): array; } class ReflectionEnumCase { public function getAttributes(): array; } trait AsScalar { public function toScalar(string $which); public static function fromScalar(string $which, $scalar): static; } enum Suit { use AsScalar; #[Scalar('db', 'h'), Scalar('json', 'hearts')] case Hearts; #[Scalar('db', 'd'), Scalar('json', 'diamonds')] case Diamonds; #[Scalar('db', 'c'), Scalar('json', 'clubs')] case Clubs; #[Scalar('db', 's'), Scalar('json', 'spades')] case Spades; } echo Suit::Hearts->toScalar('db'); // h echo Suit::Hearts->toScalar('json'); // hearts echo Suit::fromScalar('db', 'h'); // Hearts echo Suit::fromScalar('json', 'hearts'); // Hearts */

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.0150.00417.15
8.5.20.0100.00620.38
8.5.10.0140.00716.58
8.5.00.0120.00919.89
8.4.180.0130.00819.52
8.4.170.0110.01220.28
8.4.160.0130.01023.98
8.4.150.0090.00416.85
8.4.140.0060.01417.42
8.4.130.0120.00717.54
8.4.120.0110.00820.32
8.4.110.0090.01022.40
8.4.100.0110.00917.69
8.4.90.0120.00918.56
8.4.80.0080.01217.43
8.4.70.0030.00518.70
8.4.60.0120.00518.71
8.4.50.0110.00918.60
8.4.40.0100.01017.52
8.4.30.0080.00620.21
8.4.20.0130.00619.61
8.4.10.0040.00419.09
8.3.300.0110.00820.79
8.3.290.0120.00720.65
8.3.280.0100.01018.16
8.3.270.0090.01016.35
8.3.260.0070.00816.40
8.3.250.0090.01018.70
8.3.240.0120.00716.48
8.3.230.0120.00616.56
8.3.220.0130.00516.93
8.3.210.0070.00716.59
8.3.200.0060.00416.47
8.3.190.0140.00517.28
8.3.180.0110.00719.05
8.3.170.0130.00616.70
8.3.160.0180.00017.04
8.3.150.0110.00719.07
8.3.140.0080.00018.98
8.3.130.0030.00716.70
8.3.120.0030.00618.68
8.3.110.0000.01920.94
8.3.100.0070.00324.06
8.3.90.0180.00026.77
8.3.80.0030.00918.05
8.3.70.0110.00416.61
8.3.60.0120.00316.38
8.3.50.0070.01124.58
8.3.40.0110.00320.01
8.3.30.0110.00418.42
8.3.20.0080.00024.18
8.3.10.0030.00524.66
8.3.00.0040.00426.16
8.2.300.0110.01022.25
8.2.290.0100.00220.57
8.2.280.0130.00718.24
8.2.270.0170.00318.27
8.2.260.0100.00716.30
8.2.250.0000.00818.54
8.2.240.0130.00718.54
8.2.230.0060.00322.58
8.2.220.0160.00337.54
8.2.210.0100.00726.77
8.2.200.0060.00316.38
8.2.190.0100.00316.58
8.2.180.0130.00925.92
8.2.170.0150.00018.79
8.2.160.0130.00322.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00026.35
8.2.110.0000.00919.39
8.2.100.0090.00317.60
8.2.90.0080.00019.45
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0080.00017.68
8.2.50.0080.00018.07
8.2.40.0030.00519.76
8.2.30.0040.00417.93
8.2.20.0040.00417.98
8.2.10.0000.00719.17
8.2.00.0070.00018.98
8.1.340.0100.01121.64
8.1.330.0130.00719.95
8.1.320.0110.00915.90
8.1.310.0070.01116.47
8.1.300.0050.00518.26
8.1.290.0100.00330.84
8.1.280.0100.01025.92
8.1.270.0060.00323.99
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0000.00919.09
8.1.230.0070.00322.20
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0000.01017.22
8.1.190.0040.00417.10
8.1.180.0100.00018.10
8.1.170.0000.00818.47
8.1.160.0040.00418.71
8.1.150.0000.00818.64
8.1.140.0040.00418.66
8.1.130.0030.00320.00
8.1.120.0040.00417.26
8.1.110.0080.00017.36
8.1.100.0050.00217.28
8.1.90.0000.00717.37
8.1.80.0070.00317.32
8.1.70.0070.00017.33
8.1.60.0040.00417.43
8.1.50.0040.00417.40
8.1.40.0040.00417.27
8.1.30.0060.00317.41
8.1.20.0030.00617.49
8.1.10.0000.00717.32
8.1.00.0040.00417.32
8.0.300.0040.00419.89
8.0.290.0090.00016.63
8.0.280.0030.00318.30
8.0.270.0000.00717.88
8.0.260.0060.00018.21
8.0.250.0000.00716.79
8.0.240.0030.00316.65
8.0.230.0070.00016.73
8.0.220.0080.00016.84
8.0.210.0000.00716.74
8.0.200.0000.00616.82
8.0.190.0040.00416.71
8.0.180.0030.00316.68
8.0.170.0050.00316.78
8.0.160.0040.00416.77
8.0.150.0040.00416.68
8.0.140.0060.00316.66
8.0.130.0000.00513.16
8.0.120.0000.00716.71
8.0.110.0000.00916.62
8.0.100.0000.00816.68
8.0.90.0030.00316.66
8.0.80.0040.01116.79
8.0.70.0040.00416.78
8.0.60.0040.00416.64
8.0.50.0000.00716.56
8.0.30.0120.01116.79
8.0.20.0130.00816.91
8.0.10.0040.00416.97
8.0.00.0090.00916.56
7.4.330.0020.00215.55
7.4.320.0030.00316.36
7.4.300.0000.00716.34
7.4.290.0040.00416.21
7.4.280.0000.00816.34
7.4.270.0000.00716.36
7.4.260.0050.00013.08
7.4.250.0050.00216.26
7.4.240.0050.00316.48
7.4.230.0030.00316.29
7.4.220.0020.00516.32
7.4.210.0100.00816.48
7.4.200.0000.00716.24
7.4.130.0090.00816.38
7.4.120.0120.00616.48
7.4.110.0100.00716.28
7.4.100.0120.00616.26
7.4.90.0130.01016.39
7.4.80.0070.01116.31
7.4.70.0090.00916.30
7.4.60.0040.01316.19
7.4.50.0120.00916.27
7.4.40.0030.02016.21
7.4.30.0100.00716.40
7.4.20.0150.00616.27
7.4.10.0090.00916.41
7.4.00.0070.01016.51
7.3.330.0030.00316.18
7.3.320.0030.00313.06
7.3.310.0060.00016.18
7.3.300.0060.00016.03
7.3.290.0090.00716.13
7.3.280.0000.01816.11
7.3.260.0070.01616.22
7.3.230.0150.00916.21
7.3.220.0130.01016.13
7.3.210.0140.00316.07
7.3.200.0150.00816.02
7.3.190.0120.00816.30
7.3.180.0090.01216.27
7.3.170.0090.01216.29
7.3.160.0100.00716.21
7.3.150.0100.01016.18
7.3.140.0040.01216.22
7.3.130.0110.00516.07
7.3.120.0150.00316.25
7.3.110.0190.00316.00
7.3.100.0180.00416.38
7.3.90.0060.01616.32
7.3.80.0110.01116.12
7.3.70.0080.00916.32
7.3.60.0100.01016.18
7.3.50.0110.00716.22
7.3.40.0070.00916.27
7.3.30.0080.00816.09
7.3.20.0090.00916.34
7.3.10.0090.00916.18
7.3.00.0070.01016.16
7.2.330.0030.01416.34
7.2.320.0170.00616.30
7.2.310.0160.00616.32
7.2.300.0130.00416.47
7.2.290.0110.00616.39
7.2.280.0120.00916.22
7.2.270.0030.01916.46
7.2.260.0100.00716.44
7.2.250.0070.01116.48
7.2.240.0130.01016.40
7.2.230.0060.01616.51
7.2.220.0120.01216.34
7.2.210.0110.00716.39
7.2.200.0100.00716.20
7.2.190.0110.00716.39
7.2.180.0030.01416.36
7.2.170.0070.01016.26
7.2.160.0100.00716.39
7.2.150.0060.01316.51
7.2.140.0080.00816.41
7.2.130.0140.00316.28
7.2.120.0060.01016.29
7.2.110.0120.00616.45
7.2.100.0070.01016.46
7.2.90.0070.01016.57
7.2.80.0030.01416.36
7.2.70.0060.01416.36
7.2.60.0090.00916.22
7.2.50.0080.01416.41
7.2.40.0210.01216.44
7.2.30.0090.00916.45
7.2.20.0090.01316.39
7.2.10.0090.01016.38
7.2.00.0100.01016.19

preferences:
54.99 ms | 1467 KiB | 5 Q