3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 0 => [ 'Label 1' => 1, // member C1 'Label 2' => 0, 'Label 3' => 0, ], 1 => [ 'Label 1' => 0, 'Label 2' => 0, 'Label 3' => 1, // member C2 ], 2 => [ 'Label 1' => 0, 'Label 2' => 1, // member C3 'Label 3' => 0, ] ]; ?> <table> <thead> <tr> <td>Label</td> <td>Group</td> </tr> </thead> <tbody> <?php foreach($data[0] as $label => $value): ?> <tr> <td><?php echo $label; ?></td> <td><?php if($value == 1) { echo 'C1'; } if($data[1][$label] == 1) { echo 'C2'; } if($data[2][$label] == 1) { echo 'C3'; } ?></td> </tr> <?php endforeach; ?> </tbody> </table>
Output for git.master, git.master_jit, rfc.property-hooks
<table> <thead> <tr> <td>Label</td> <td>Group</td> </tr> </thead> <tbody> <tr> <td>Label 1</td> <td>C1</td> </tr> <tr> <td>Label 2</td> <td>C3</td> </tr> <tr> <td>Label 3</td> <td>C2</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:
107.66 ms | 406 KiB | 5 Q