3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = <<<'EOL' <?php echo "$var"; echo "text $var text"; echo "text"; ?> EOL; highlight_string($str);
based on R1BOq

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
<code><span style="color: #000000"> &nbsp;&nbsp;<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$var</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"text&nbsp;</span><span style="color: #0000BB">$var</span><span style="color: #DD0000">&nbsp;text"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"text"</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span> </span> </code>
Output for Array change keys
<code><span style="color: #000000"> &nbsp;&nbsp;<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$var</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"text&nbsp;</span><span style="color: #0000BB">$var</span><span style="color: #DD0000">&nbsp;text"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"text"</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span> </span> </code>
Output for Lexical anon
<code><span style="color: #000000"> &nbsp;&nbsp;<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$var</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"text&nbsp;</span><span style="color: #0000BB">$var</span><span style="color: #DD0000">&nbsp;text"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"text"</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;</span> </span> </code>

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