<?php
/* testNotAcceptedTypeExceptionOutsideAttribute1 */
/**
* Docblock
*/
#[Attribute]
function notAcceptedTokenOutsideAttributeTest() {}
/* testNotAcceptedTypeExceptionOutsideAttribute2 */
echo 'notAcceptedTokenOutsideAttributeTest';
/* testAcceptedTokens */
#[AttributeName(10), \AnotherAttribute, namespace\ThirdAttribute(self::CONSTANT, 'foo')]
function acceptedTokensAttributeTarget() {}
/* testFindUnscopedConst */
#[MyAttribute]
const UNSCOPED = true;
array_map(
/* testFindUnscopedClosure */
#[MyAttribute]
function($a) {
return $a++;
},
$array
);
/* testFindUnscopedClosureStatic */
$closure = #[MyAttribute] static function($a) {};
array_map(
/* testFindUnscopedArrowFunction */
#[MyAttribute]
fn($a) => $a++,
$array
);
/* testFindUnscopedArrowFunctionStatic */
$closure = #[MyAttribute] static fn ($a) => $a * 10;
function hasParamAttributes(
/* testFindFunctionParameter */
#[MyAttribute]
#[AnotherAttribute]
$paramA,
/* testFindFunctionParameterTypedNullable */
#[MyAttribute] ?int $paramB,
/* testFindFunctionParameterTypedUnion */
#[MyAttribute] int|false $paramC,
/* testFindFunctionParameterWithRef */
#[MyAttribute]
// Unrelated comment
&$paramD,
/* testFindFunctionParameterWithSpread */
#[MyAttribute]
/** docblock */
...$paramE,
/* testFindFunctionParameterAllTogetherNow */
#[MyAttribute] (\Foo|Partial\Bar|namespace\Other)|array &...$paramF,
) {}
/* testFindClass */
#[MyAttribute]
class classHasAttribute {}
/* testFindClassFinal */
#[MyAttribute]
/**
* Docblock.
*/
#[AnotherAttribute]
final class finalClass {}
/* testFindClassReadonly */
#[MyAttribute]
readonly class readonlyClass {}
/* testFindClassAbstract */
#[MyAttribute]
abstract class abstractClass {}
/* testFindClassFinalReadonly */
#[MyAttribute]
// Unrelated comment.
// Another unrelated comment.
final readonly class finalReadonlyClass {}
/* testFindAnonClass */
$anon = new #[MyAttribute] #[SecondAttribute] class {};
/* testFindAnonClassReadonly */
$anon = new #[MyAttribute] readonly class {};
/* testFindTrait */
#[MyAttribute(10), \Another]
trait traitHasAttribute {}
/* testFindInterface */
#[MyAttribute]
#[AnotherAttributeWithBlankLinesAroundIt(
name: VALUE,
other_name: VALUE,
)]
- Output for git.master_jit, git.master
- Parse error: syntax error, unexpected token "|", expecting token "&" in /in/ZGPdg on line 66
Process exited with code 255.
This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.
Active branches
Archived branches
Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page
preferences:
134.59 ms | 995 KiB | 7 Q