- var_dump: documentation ( source)
<?php
class Record {
private $index=0; //page index
private $pages=[]; //pages array
public function nextPage() {
$this->index++;
}
public function addRecord($key, $value) {
$this->$pages[$this->index][$key] = $value;
}
public function getPage($index) {
if ($index > $this->index)
return NULL;
else
return $this->pages[$this->index];
}
}
$r = new Record();
$r->addRecord("t","m");
var_dump($r->getPage(0));