1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 14:12:38 +02:00
Files
archived-php-src/ext/spl/tests/array_012.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

61 lines
736 B
PHP

--TEST--
SPL: ArrayIterator::count
--FILE--
<?php
echo "===Array===\n";
$a = array('zero' => 0, 'one' => 1, 'two' => 2);
$it = new ArrayIterator($a);
var_dump($it->count());
foreach($it as $key => $val)
{
echo "$key=>$val\n";
var_dump($it->count());
}
var_dump($it->count());
echo "===Object===\n";
class test
{
public $zero = 0;
protected $pro;
public $one = 1;
private $pri;
public $two = 2;
}
$o = new test;
$it = new ArrayIterator($o);
var_dump($it->count());
foreach($it as $key => $val)
{
echo "$key=>$val\n";
var_dump($it->count());
}
var_dump($it->count());
?>
--EXPECT--
===Array===
int(3)
zero=>0
int(3)
one=>1
int(3)
two=>2
int(3)
int(3)
===Object===
int(3)
zero=>0
int(3)
one=>1
int(3)
two=>2
int(3)
int(3)