3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array('Title 1'=>'text11', 'Title 2'=>'text12'), array('Title 1'=>'text21', 'Title 2'=>'text22'), array('Title 1'=>'text31', 'Title 2'=>'text32'), array('Title 1'=>'text41', 'Title 2'=>'text42', 'special'=>'style1'), array('Title 1'=>'text51', 'Title 2'=>'text52', 'special'=>'style2'), ); ?> <table> <thead> <tr> <th>Title 1</th> <th>Title 2</th> </tr> </thead> <tbody> <?php foreach ($data as $key=>$row): if (isset($row["special"])) { $class = " class='" . $row["special"]. "'"; unset($row["special"]); } else { $class=''; }?> <tr<?php echo $class ?>> <td><?php echo implode('</td><td>', $row); ?></td> </tr> <?php endforeach; ?> </tbody> </table>
Output for git.master, git.master_jit, rfc.property-hooks
<table> <thead> <tr> <th>Title 1</th> <th>Title 2</th> </tr> </thead> <tbody> <tr> <td>text11</td><td>text12</td> </tr> <tr> <td>text21</td><td>text22</td> </tr> <tr> <td>text31</td><td>text32</td> </tr> <tr class='style1'> <td>text41</td><td>text42</td> </tr> <tr class='style2'> <td>text51</td><td>text52</td> </tr> </tbody> </table>

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:
169.93 ms | 407 KiB | 5 Q