GoLang Phar::hasMetadata

request it (406)
GoLang replacement for PHP's Phar::hasMetadata [edit | history]



Do you know a GoLang replacement for PHP's Phar::hasMetadata? Write it!

PHP Phar::hasMetadata

PHP original manual for Phar::hasMetadata [ show | php.net ]

Phar::hasMetadata

(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 1.2.0)

Phar::hasMetadataReturns whether phar has global meta-data

Description

public bool Phar::hasMetadata ( void )

Returns whether phar has global meta-data set.

Parameters

No parameters.

Return Values

Returns TRUE if meta-data has been set, and FALSE if not.

Examples

Example #1 A Phar::hasMetadata() example

<?php
try {
    
$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
}
?>

The above example will output:

bool(false)
bool(true)
bool(false)

See Also