I use HHVM to write a system tool, and I can’t understand for life why this code throws an error on startup hh_client
$__al_paths = array();
function requires(string $classPath): void {
global $__al_paths;
$className = basename($classPath);
if (!isset($__al_paths[$className])) {
$__al_paths[$className] = AL_CLASSES_FOLDER.'/'.$classPath.'.'.AL_CLASS_EXTENSION;
}
}
At startup hh_client
the following occurs:/usr/lib/mango/tools/autoloader.hh:9:9,19: Expected
The line he points to is the line that says
global $__al_paths;
What is announced in the area global. This seems like a syntax error, since the keyword is globalnot supported in HHVM, however I checked the documentation and it has some examples of using this code in Hack code.
source
share