Warning: file_put_contents(): Only -1 of 52 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
Phar::__construct Phar->getMetaData phar PHP Manual Phar->count (PECL phar:1.0.0-1.2.1) Phar->count — Returns the number of entries (files) in Phar archive Descrierea int ( void ) Parametri V...
Forum und email

Phar->count

(PECL phar:1.0.0-1.2.1)

Phar->count — Returns the number of entries (files) in the Phar archive

Descrierea

int Phar->count ( void )

Parametri

Valorile întroarse

The number of files contained within this phar, or 0 (the number zero) if none.

Exemple

Example#1 A Phar->count() example

<?php
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
    
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar'0'brandnewphar.phar');
} catch (
Exception $e) {
    echo 
'Could not create phar:'$e;
}
echo 
'The new phar has ' $p->count() . " entries\n";
$p['file.txt'] = 'hi';
echo 
'The new phar has ' $p->count() . " entries\n";
?>

Exemplul de mai sus va afiÅŸa:

The new phar has 0 entries
The new phar has 1 entries