3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @return non-empty-list<non-empty-string> */ function valueTypes(mixed $value): array { if (is_object($value)) { return [ $value::class, ...array_values(class_parents($value)), ...array_values(class_implements($value)), ]; } return [get_debug_type($value)]; } interface I1 {} interface I2 {} abstract class A implements I1 {} final class B extends A implements I2 {} var_dump(valueTypes(1)); var_dump(valueTypes('string')); var_dump(valueTypes(new B()));

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.4.120.0120.00923.99
8.4.110.0110.00918.56
8.4.100.0090.01219.02
8.4.90.0100.00820.63
8.4.80.0050.00518.55
8.4.70.0090.00618.16
8.4.60.0110.00618.76
8.4.50.0120.00918.45
8.4.40.0160.00317.63
8.4.30.0000.01020.30
8.4.20.0170.00317.82
8.4.10.0140.00719.41
8.3.250.0130.00719.07
8.3.240.0070.00316.81
8.3.230.0120.00416.64
8.3.220.0130.00518.73
8.3.210.0110.00916.62
8.3.200.0020.00716.65
8.3.190.0100.00819.17
8.3.180.0110.00717.41
8.3.170.0150.00318.91
8.3.160.0040.00416.52
8.3.150.0070.01117.41
8.3.140.0140.00416.46
8.3.130.0040.00418.50
8.3.120.0110.00720.34
8.3.110.0030.01320.94
8.3.100.0000.00724.06
8.3.90.0160.00326.77
8.3.80.0060.00316.48
8.3.70.0120.00316.58
8.3.60.0130.00316.75
8.3.50.0090.01224.40
8.3.40.0040.01118.71
8.3.30.0040.01118.58
8.3.20.0050.00224.18
8.3.10.0030.00524.66
8.3.00.0070.00026.16
8.2.290.0090.00720.47
8.2.280.0100.01118.14
8.2.270.0150.00317.17
8.2.260.0070.00718.31
8.2.250.0090.00616.37
8.2.240.0120.00016.89
8.2.230.0040.00422.58
8.2.220.0070.00337.54
8.2.210.0090.00026.77
8.2.200.0040.00416.75
8.2.190.0110.00416.63
8.2.180.0040.01125.92
8.2.170.0040.01118.72
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00320.58
8.2.110.0090.00020.38
8.2.100.0060.00320.71
8.1.330.0050.00522.01
8.1.320.0100.00917.93
8.1.310.0000.01616.19
8.1.300.0070.00720.25
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0100.00018.50
8.1.230.0060.00622.18
8.0.30.0060.00917.16
8.0.20.0130.00716.98
8.0.10.0090.01116.99
8.0.00.0100.00917.00
7.4.160.0030.01116.45
7.4.150.0110.00716.35
7.4.140.0080.00916.29
7.4.130.0090.00816.37
7.4.120.0100.00916.33
7.4.110.0120.00716.28
7.4.100.0090.00916.15
7.4.90.0110.00816.22
7.4.80.0110.00816.23
7.4.70.0120.00816.32
7.4.60.0100.00816.31
7.4.50.0100.01016.33
7.4.40.0110.00716.27
7.4.30.0080.01016.18
7.4.20.0100.00916.33
7.4.10.0100.00816.34
7.4.00.0090.00916.41
7.3.270.0090.00916.27
7.3.260.0090.00616.25
7.3.250.0080.00916.22
7.3.240.0120.00716.13
7.3.230.0120.00816.17
7.3.220.0040.01416.17
7.3.210.0070.01316.20
7.3.200.0120.00616.21
7.3.190.0070.01116.23
7.3.180.0080.01016.13
7.3.170.0110.00816.22
7.3.160.0130.00716.23
7.3.150.0080.01016.18
7.3.140.0080.00916.23
7.3.130.0100.00916.12
7.3.120.0100.00816.17
7.3.110.0070.00916.16
7.3.100.0080.01016.20
7.3.90.0130.00616.21
7.3.80.0100.01016.04
7.3.70.0090.00916.13
7.3.60.0100.00916.12
7.3.50.0110.00816.16
7.3.40.0110.00716.07
7.3.30.0090.00916.18
7.3.20.0130.00716.14
7.3.10.0110.00716.15
7.3.00.0100.00916.19

preferences:
28.52 ms | 403 KiB | 5 Q