3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [['xxx', 3], ['yyy', 2]]; var_export( array_reduce( $array, fn($result, $row) => [...$result, ...array_fill(0, $row[1], [$row[0]])], [] ) );
Output for git.master_jit, git.master
array ( 0 => array ( 0 => 'xxx', ), 1 => array ( 0 => 'xxx', ), 2 => array ( 0 => 'xxx', ), 3 => array ( 0 => 'yyy', ), 4 => array ( 0 => 'yyy', ), )

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:
24.71 ms | 405 KiB | 5 Q