mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
5571765609
One of the weirdest pieces of PHP code I've ever seen. In terms of tokens, this gets internally translated to use x as y; echo as my_echo; On master it crashes because this "echo" does not have attached identifier metadata. Make sure it is added and then reject the use of "<?=" as an identifier inside zend_lex_tstring. Fixes oss-fuzz #23547.
16 lines
240 B
PHP
16 lines
240 B
PHP
--TEST--
|
|
<?= cannot be used as an identifier
|
|
--FILE--
|
|
<?php
|
|
trait T {
|
|
public function x() {}
|
|
}
|
|
class C {
|
|
use T {
|
|
x as y?><?= as my_echo;
|
|
}
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Parse error: Cannot use "<?=" as an identifier in %s on line %d
|