3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParent { const NAVIGATION = 'nav'; public static function getUri() { static $uri = null; if ($uri === null) { echo 'null<br>'; $uri = 'test '.static::NAVIGATION; } return $uri; } } class FirstChild extends MyParent { } class SecondChild extends MyParent { const NAVIGATION = 'childnav'; } $first = new FirstChild(); $second = new SecondChild(); echo '<pre>', var_export($first->getUri(), true), '</pre>'; echo '<pre>', var_export($second->getUri(), true), '</pre>'; echo '<pre>', var_export($first->getUri(), true), '</pre>'; echo '<pre>', var_export($second->getUri(), true), '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
<pre>null<br>'test nav'</pre><pre>'test nav'</pre><pre>'test nav'</pre><pre>'test nav'</pre>

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.49 ms | 401 KiB | 8 Q