1. Go to this page and download the library: Download nayleen/attribute library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use function Nayleen\Attribute\get;
#[Attribute(Attribute::IS_REPEATABLE)]
final class RepeatableAttribute
{
public function __construct(private string $value) {}
}
#[RepeatableAttribute('foo')]
#[RepeatableAttribute('bar')]
class MyClass {}
$value = get(MyClass::class, 'RepeatableAttribute'); // ["foo", "bar"]
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.