3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Требует от поля быть не-пустым при валидации */ #[Attribute] class NotBlank { public function __construct(private readonly string $errorMessage) { } } class Student { #[NotBlank('Имя заполнять кто будет?')] private string $name; } // Получаем студента $student = new Student(); // Получаем объект атрибута $reflProp = new ReflectionProperty(Student::class, 'name'); var_dump($reflProp->getAttributes()); var_dump($reflProp->getAttributes()[0]->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.4.120.0120.00817.62
8.4.110.0120.00724.22
8.4.100.0110.00717.71
8.4.90.0060.00920.73
8.4.80.0090.00417.95
8.4.70.0110.00917.97
8.4.60.0120.00818.73
8.4.50.0080.00720.54
8.4.40.0140.00717.70
8.4.30.0040.00418.93
8.4.20.0130.00617.85
8.4.10.0080.00019.50
8.3.250.0110.00916.75
8.3.240.0150.00516.74
8.3.230.0050.00316.59
8.3.220.0100.01018.91
8.3.210.0050.00416.43
8.3.200.0050.00316.69
8.3.190.0120.00616.84
8.3.180.0040.00416.78
8.3.170.0070.01020.72
8.3.160.0080.00018.58
8.3.150.0000.01816.71
8.3.140.0090.00921.03
8.3.130.0040.00418.69
8.3.120.0030.00620.64
8.3.110.0030.00622.58
8.3.100.0030.00622.58
8.3.50.0030.00622.58
8.3.00.0190.00128.09
8.2.290.0040.00616.56
8.2.280.0060.00318.20
8.2.270.0040.01516.77
8.2.260.0080.00816.79
8.2.250.0070.01116.57
8.2.240.0070.01318.98
8.2.230.0160.00022.58
8.2.220.0000.00922.58
8.1.330.0080.00516.05
8.1.320.0110.00715.97
8.1.310.0110.00416.11
8.1.300.0060.00318.44

preferences:
43.77 ms | 403 KiB | 5 Q