Consider this script
class B
{
static public function hi() { echo \"hi\\n\"; }
}
class A
{
private $name = \'B\';
public function __construct()
The current implementation of Zend PHP parser supports only static method calls that are made directly on a class name or a variable. Here is the grammar:
%token T_PAAMAYIM_NEKUDOTAYIM ":: (T_PAAMAYIM_NEKUDOTAYIM)"
function_call:
name argument_list
{ $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
| class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
{ $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
{ $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1, $3, $4); }
| callable_expr argument_list
{ $$ = zend_ast_create(ZEND_AST_CALL, $1, $2); }
Source: https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L890