note 129356 added to language.attributes.overview

From: Date: Tue, 26 Mar 2024 14:33:54 +0000
Subject: note 129356 added to language.attributes.overview
Groups: php.notes 
Request: Send a blank email to php-notes+get-221259@lists.php.net to get a copy of this message
<?php use App\Concat; require_once __DIR__ . '/vendor/autoload.php'; //echo 'Welcome To phpunit 11.0'; class WordConcat{ #[Concat('php attributes')] public static function welcome(): string { return 'welcome '; } } $reflectionClass = new ReflectionClass(new WordConcat()); foreach ($reflectionClass->getMethods() as $method) { $attributes = $method->getAttributes(); foreach ($attributes as $attribute){ $result = call_user_func([WordConcat::class, $method->getName()]) . $attribute->newInstance()->value; dd($result); } } ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.13.131 (proxied: 197.53.148.5) ---- Manual Page -- https://php.net/manual/en/language.attributes.overview.php Edit -- https://main.php.net/note/edit/129356 Del: integrated -- https://main.php.net/note/delete/129356/integrated Del: useless -- https://main.php.net/note/delete/129356/useless Del: bad code -- https://main.php.net/note/delete/129356/bad+code Del: spam -- https://main.php.net/note/delete/129356/spam Del: non-english -- https://main.php.net/note/delete/129356/non-english Del: in docs -- https://main.php.net/note/delete/129356/in+docs Del: other reasons-- https://main.php.net/note/delete/129356 Reject -- https://main.php.net/note/reject/129356 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221259) next »