\fprintf(STDERR,"Saw constant with non-string name of %s. There may be a bug in a PECL extension you are using (php -m will list those)\n",\var_representation($const_name));
\fprintf(STDERR,"Failed to load global constant value for %s, continuing: %s\n",\var_representation($const_name),$e->getMessage());
}
/**
* @param list<string> $new_file_list
* @param array<string,string> $file_mapping_contents maps relative path to absolute paths
* @param ?(string[]) $reanalyze_files files to re-analyze
* @return list<string> - Subset of $new_file_list which changed on disk and has to be parsed again. Automatically unparses the old versions of files which were modified.
// make a deep copy of the NamespaceMapEntry objects within parsed_namespace_maps
// NOTE: It is faster to *create* the clone if this used unserialize(serialize(parsed_namespace_maps).
// However, it is 10 times slower once you include the time needed to garbage collect the data in the copies, because strings in values are brand new copies in unserialize().
// 1. this is an internal function that hasn't been loaded yet.
// 2. Unless 'ignore_undeclared_functions_with_known_signatures' is true, require that the current php binary or its extensions define this function before that.
// Unit tests call this on every test case. Cache the **internal** constants in a static variable for efficiency; those won't change.
static$constant_name_list=null;
if($constant_name_list===null){
// 'true', 'false', and 'null' aren't actually defined constants, they're keywords? Add them because anything using AST_CONST would expect them to exist.
$details=\sprintf('target_php_version=%s run with PHP %s',self::phpVersionIdToString($target_php_version_config),self::phpVersionIdToString(\PHP_VERSION_ID));
$suggestion=\sprintf(
'(to use the function %s() added in PHP %s in a project with %s without a polyfill parsed by Phan)',
$function_name,
self::phpVersionIdToString($next_target),
$details
);
return[$suggestion];
}
}
}
return[];
}
/**
* @internal
*/
protectedconst_NON_CLASS_TYPE_SUGGESTION_SET=[
'array'=>'array',
'bool'=>'bool',
'callable'=>'callable',
'false'=>'false',
'float'=>'float',
'int'=>'int',
'iterable'=>'iterable',
'mixed'=>'mixed',
'null'=>'null',
'object'=>'object',
'resource'=>'resource',
'scalar'=>'scalar',
'self'=>'self',
'static'=>'static',
'string'=>'string',
'true'=>'true',
// 'void' only makes sense for return type suggestions
];
/**
* @return list<FullyQualifiedFunctionName|string> 0 or more namespaced function names found in this code base in $namespace