3v4l.org

run code in 300+ PHP versions simultaneously
<?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));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $pages in /in/MQMgP on line 12 Deprecated: Creation of dynamic property Record::$ is deprecated in /in/MQMgP on line 12 Warning: Undefined array key 0 in /in/MQMgP on line 18 NULL

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
58.01 ms | 401 KiB | 8 Q