1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Files
archived-php-src/ext/tokenizer/tests/attributes.phpt
T
Theodore Brown 470d1696d9 Implement Shorter Attribute Syntax
RFC: https://wiki.php.net/rfc/shorter_attribute_syntax

Closes GH-5796.

Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
2020-07-28 15:28:57 +02:00

21 lines
352 B
PHP

--TEST--
Attributes are exposed as tokens.
--FILE--
<?php
$tokens = token_get_all('<?php @@A1(1, 2) class C1 { }');
$attr = $tokens[1];
var_dump(token_name(T_ATTRIBUTE));
var_dump($attr[0] === T_ATTRIBUTE);
var_dump($attr[1]);
$class = $tokens[2];
var_dump($class[1]);
?>
--EXPECT--
string(11) "T_ATTRIBUTE"
bool(true)
string(2) "@@"
string(2) "A1"