3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute(Attribute::TARGET_CLASS|Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD)] class Template { public function __construct( public string $name, public ?string $of = null, ) {} } #[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD|Attribute::TARGET_PARAMETER|Attribute::TARGET_PROPERTY)] class Type { public function __construct( public string $name, ) {} } #[Template(T)] #[Type(array<int,T>)] function asArray( #[Type(T)] $value, ): array { return [$value]; }

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.0.00.0120.00916.64
7.4.130.0100.00716.14
7.4.120.0070.01016.22
7.4.110.0170.00016.18
7.4.100.0090.00916.33
7.4.90.0080.00815.99
7.4.80.0180.00016.33
7.4.70.0060.01216.40
7.4.60.0140.00316.34
7.4.50.0100.00616.25
7.4.40.0100.00716.31
7.4.30.0030.01516.04
7.4.20.0030.01416.32
7.4.10.0070.01016.14
7.4.00.0110.00716.42
7.3.250.0060.01016.07
7.3.240.0130.00316.07
7.3.230.0070.01016.09
7.3.220.0070.01016.33
7.3.210.0030.01416.12
7.3.200.0150.00316.42
7.3.190.0070.01016.22
7.3.180.0110.00716.38
7.3.170.0110.00616.16
7.3.160.0080.00816.26
7.3.150.0100.00716.13
7.3.140.0150.00416.21
7.3.130.0030.01316.24
7.3.120.0070.01016.38
7.3.110.0030.01316.20
7.3.100.0070.01016.13
7.3.90.0060.01116.19
7.3.80.0030.01416.22
7.3.70.0070.01416.21
7.3.60.0000.01716.05
7.3.50.0080.00816.01
7.3.40.0100.00716.19
7.3.30.0060.01216.26
7.3.20.0140.00316.06
7.3.10.0030.01416.05
7.3.00.0060.01216.06

preferences:
141.62 ms | 1394 KiB | 7 Q