The PharData constructor is declared as such:
PharData::__construct ( string $fname [, int $flags [, string $alias [, int $format = Phar::TAR ]]] )
$alias
is documented as:
Alias with which this Phar archive should be referred to in calls to stream functionality.
$format
, but not $alias
? Should I pass an empty string, or NULL
?The $alias
parameter is optional. It's intended to allow accessing phar contents later without the full .phar path or filename. Commonly for self-contained PHARs, you might want to map it relocateable as e.g. phar://myphar/script1.php
You can just pass in NULL
or an empty string to skip this parameter.
In phar.c
the primary test before registering an alias is just the string length:
https://github.com/php/php-src/blob/master/ext/phar/phar.c#L988