3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'hello there world!'; echo 'The date is... who cares?'; $thingy = new Thingy(); $thingy->setArray(['tit' => 'eh']); $thingy->displayIfIndexExists('tit'); class Thingy { private $array; // or in __construct(), also get public function setArray(Array $array) { $this->array = $array; } public function displayIfIndexExists($tit) { if (array_key_exists($tit, $this->array)) { echo $this->array[$tit]; } } public function getIndexIfExists($tit) { return (array_key_exists($tit, $this->array)) ? ($this->array[$tit]) : false; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
hello there world!The date is... who cares?eh

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:
40.59 ms | 401 KiB | 8 Q