3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "title" => [ 0 => "title1", 1 => "title2", 2 => "title3", ], "icon-class" => [ 0 => "class1", 1 => "class2", 2 => "class3", ], "text" => [ 0 => "text1", 1 => "text2", 2 => "text3", ], "link-text" => [ 0 => "link-text1", 1 => "link-text2", 2 => "link-text3", ], "link" => [ 0 => "link-text1", 1 => "link-text2", 2 => "link-text3", ], ]; // fetching keys $keys = array_keys($arr); // transposing array with removing string keys to integer $temp = array_map(null, ...array_values($arr)); // combining fetched keys and values by transpose $temp = array_map(function ($item) use ($keys) {return array_combine($keys, $item);}, $temp); ?> <ul> <?php foreach($temp as $v): ?> <li> <h3 class="<?php echo $v['icon-class'] ?>"><?php echo $v['title'];?></h3> <p><?php echo $v['text'];?></p> <a href="<?php echo $v['link']; ?>"><?php echo $v['link-text']?></a> </li> <?php endforeach; ?> </ul>
Output for git.master, git.master_jit, rfc.property-hooks
<ul> <li> <h3 class="class1">title1</h3> <p>text1</p> <a href="link-text1">link-text1</a> </li> <li> <h3 class="class2">title2</h3> <p>text2</p> <a href="link-text2">link-text2</a> </li> <li> <h3 class="class3">title3</h3> <p>text3</p> <a href="link-text3">link-text3</a> </li> </ul>

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:
117.13 ms | 406 KiB | 5 Q