3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { public $atr1; public $atr2; public $atr3; function _construct($atr1,$atr2,$atr3) { $this->atr1=$atr1; $this->atr2=$atr2; $this->atr3=$atr3; } } function napln() { $obj1 = new Car('renault','modra','nieco'); $obj2 = new Car('skoda','zelena','neviem'); $obj3 = new Car('opel','cervena','cojaviem'); $pole = array($obj1, $obj2, $obj3); return $pole; } function tabulka() { $table_str='<table>'; $table=napln(); foreach($table as $tab) { $table_str.= '<tr>'; $table_str.=' <td>$tab -> $atr1</td> <td>$tab -> $atr1</td> <td>$tab -> $atr3</td>'; $table_str.='</tr>'; } $table_str.='</table>'; return $table_str; } ?> <html> <head> <title>Page Title</title> </head> <body> <?php echo tabulka(); ?> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
<html> <head> <title>Page Title</title> </head> <body> <table><tr> <td>$tab -> $atr1</td> <td>$tab -> $atr1</td> <td>$tab -> $atr3</td></tr><tr> <td>$tab -> $atr1</td> <td>$tab -> $atr1</td> <td>$tab -> $atr3</td></tr><tr> <td>$tab -> $atr1</td> <td>$tab -> $atr1</td> <td>$tab -> $atr3</td></tr></table> </body> </html>

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:
51.89 ms | 402 KiB | 8 Q