PHP 5.4.31 Released

Phar::hasMetadata

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

Phar::hasMetadataReturns whether phar has global meta-data

Descrizione

public bool Phar::hasMetadata ( void )

Returns whether phar has global meta-data set.

Elenco dei parametri

No parameters.

Valori restituiti

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

Esempi

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
}
?>

Il precedente esempio visualizzerĂ :

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

Vedere anche:

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top