3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute(Attribute::TARGET_PROPERTY)] class PropertyAttributes { public function __construct( public readonly ?string $name = null, public readonly ?string $label = null, ) {} } #[Attribute(Attribute::TARGET_PROPERTY)] class IntegerPropertyAttributes extends PropertyAttributes { public function __construct( ?string $name = null, ?string $label = null, public readonly ?int $default = null, public readonly ?int $min = null, public readonly ?int $max = null, public readonly ?int $step = null, ) { parent::__construct($name, $label); } } #[Attribute(Attribute::TARGET_PROPERTY)] class FloatPropertyAttributes extends PropertyAttributes { public function __construct( ?string $name = null, ?string $label = null, public readonly ?float $default = null, public readonly ?float $min = null, public readonly ?float $max = null, ) { parent::__construct($name, $label); } } class MyClass { #[IntegerPropertyAttributes('prop','property: ',5,0,10,1)] public int $prop; } $refl = new ReflectionProperty('MyClass', 'prop'); $attributes = $refl->getAttributes(); foreach ($attributes as $attribute) { var_dump($attribute->getName()); var_dump($attribute->getArguments()); var_dump($attribute->newInstance()); }

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.40.0110.01219.78
8.3.30.0160.01122.16
8.3.20.0030.01721.60
8.3.10.0110.01023.13
8.3.00.0110.00921.75
8.2.170.0150.00619.09
8.2.160.0150.00620.16
8.2.150.0100.01019.01
8.2.140.0140.00422.57
8.2.130.0130.00522.57
8.2.120.0060.01221.84
8.2.110.0060.01122.01
8.2.100.0100.00622.01
8.2.90.0110.00721.81
8.2.80.0120.00822.01
8.2.70.0120.00921.63
8.2.60.0170.00121.81
8.2.50.0120.00522.04
8.2.40.0110.00621.75
8.2.30.0080.00721.74
8.2.20.0120.00521.66
8.2.10.0160.00221.77
8.2.00.0140.00721.76
8.1.270.0110.00923.60
8.1.260.0100.01023.34
8.1.250.0170.00223.35
8.1.240.0140.00521.64
8.1.230.0080.01121.57
8.1.220.0120.00621.76
8.1.210.0140.00521.61
8.1.200.0060.01021.80
8.1.190.0120.00521.63
8.1.180.0030.01421.45
8.1.170.0100.00721.78
8.1.160.0080.00921.62
8.1.150.0140.00321.72
8.1.140.0040.01321.76
8.1.130.0060.01021.69
8.1.120.0130.00321.69
8.1.110.0090.00721.60
8.1.100.0130.00422.24
8.1.90.0080.00821.61
8.1.80.0040.00922.25
8.1.70.0080.00521.73
8.1.60.0050.00921.63
8.1.50.0080.00521.68
8.1.40.0110.00321.65
8.1.30.0060.00721.74
8.1.20.0060.00722.32
8.1.10.0090.00421.61
8.1.00.0130.00822.68

preferences:
145.25 ms | 1398 KiB | 7 Q