3v4l.org

run code in 300+ PHP versions simultaneously
<?php function section(Closure $name){ return isset($name) ? $name() : null; } $html =' @title{ Çok güzel içerik yerine bu gelecek layout.blade.php\'de }@ @acontent{ yerine bunlar geliyor layout.blade.php\'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> }@ @title{ Çok güzel içerik yerine bu gelecek layout.blade.php\'de }@ @acontent{ yerine bunlar geliyor layout.blade.php\'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> }@ '; $value = preg_replace('/@(\w+)\s*\{/ms', '<? \$$1 = function(){ ?>', $html); $value = preg_replace('/}@/s', '<? }; ?>', $value); echo $value; ?> <? $title = function(){ ?> Çok güzel içerik yerine bu gelecek layout.blade.php'de <? }; ?> <? $acontent = function(){ ?> yerine bunlar geliyor layout.blade.php'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> <? }; ?> <? $fotter = function(){ ?> Çok güzel içerik yerine bu gelecek layout.blade.php'de <? }; ?> <? $icerik = function(){ ?> yerine bunlar geliyor layout.blade.php'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> <? }; ?> <html> <head> <title></title> </head> <body> <?= section($title); ?> <?= section($icerik);?> <footer><?= section($fotter);?></footer> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
<? $title = function(){ ?> Çok güzel içerik yerine bu gelecek layout.blade.php'de <? }; ?> <? $acontent = function(){ ?> yerine bunlar geliyor layout.blade.php'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> <? }; ?> <? $title = function(){ ?> Çok güzel içerik yerine bu gelecek layout.blade.php'de <? }; ?> <? $acontent = function(){ ?> yerine bunlar geliyor layout.blade.php'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> <? }; ?> <? $title = function(){ ?> Çok güzel içerik yerine bu gelecek layout.blade.php'de <? }; ?> <? $acontent = function(){ ?> yerine bunlar geliyor layout.blade.php'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> <? }; ?> <? $fotter = function(){ ?> Çok güzel içerik yerine bu gelecek layout.blade.php'de <? }; ?> <? $icerik = function(){ ?> yerine bunlar geliyor layout.blade.php'de <p>Lorem ipsum dolor sit amet felan filan</p> <p>Sonra tekrar lorem ipsum dolor sit amet ?</p> <? }; ?> <html> <head> <title></title> </head> <body> Warning: Undefined variable $title in /in/d3KqO on line 57 Fatal error: Uncaught TypeError: section(): Argument #1 ($name) must be of type Closure, null given, called in /in/d3KqO on line 57 and defined in /in/d3KqO:2 Stack trace: #0 /in/d3KqO(57): section(NULL) #1 {main} thrown in /in/d3KqO on line 2
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:
39.1 ms | 403 KiB | 8 Q