3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { /** * Default store code * * @var string */ protected $_currentStore; public function getStore($id = null) { $id_int = $id; if (!isset($id_int) || ''===$id_int || $id_int === true) { $id_int = $this->_currentStore; echo 'assigning $id_int to $this->_currentStore :: '; } echo 'using id class : ' . get_class($id_int) . ' :: '; if (!isset($id_int)) { echo '$id_int is not set? it has a class=' . get_class($id_int); } return $id_int; } } $x = new X(); $store = $x->getStore();
Output for git.master, git.master_jit, rfc.property-hooks
assigning $id_int to $this->_currentStore :: Fatal error: Uncaught TypeError: get_class(): Argument #1 ($object) must be of type object, null given in /in/cMqLR:19 Stack trace: #0 /in/cMqLR(30): X->getStore() #1 {main} thrown in /in/cMqLR on line 19
Process exited with code 255.

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