nikic / PHP-Parser

A PHP parser written in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

php generics (for merthods)

N0zzy opened this issue · comments

commented

hi. i use your library and i have some code according to peachpie(c#+php) syntax:

image

image

how do i make the parser ignore the error (generic) or how do i add it myself?

Generics are not supported by this library (as they are not supported by upstream PHP).

However, there are some forks that extend this parser with generics support. See for example https://github.com/mrsuh/php-generics, which uses https://github.com/mrsuh/PHP-Parser/tree/generics-support. I'm not familiar with what exactly this one supports.