Php/docs/phar.hasmetadata
来自菜鸟教程
Phar::hasMetadata
(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 1.2.0)
Phar::hasMetadata — Returns whether phar has global meta-data
说明
public Phar::hasMetadata ( ) : bool
Returns whether phar has global meta-data set.
参数
No parameters.
返回值
Returns true
if meta-data has been set, and false
if not.
范例
Example #1 A Phar::hasMetadata() example
<?phptry { $phar = new Phar('myphar.phar'); var_dump($phar->hasMetadata()); $phar->setMetadata(array('thing' => 'hi')); var_dump($phar->hasMetadata()); $phar->delMetadata(); var_dump($phar->hasMetadata());} catch (Exception $e) { // handle error}?>
以上例程会输出:
bool(false) bool(true) bool(false)
参见
- Phar::getMetadata() - Returns phar archive meta-data
- Phar::setMetadata() - Sets phar archive meta-data
- Phar::delMetadata() - Deletes the global metadata of the phar