- var_dump: documentation ( source)
<?php
class Test {
public $count = 4;
public function getNext()
{
if (!$this->count) {
return null;
}
--$this->count;
return 'next';
}
}
$a = new Test();
for ($i = 0; $i < 10; $i++) {
var_dump($a->count);
var_dump($a->getNext() ?: 'none');
}