3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'sucesso' => [ 'LAUDO_VISTORIA' => [ 0 => '0027', 2 => '30027', 3 => '0027', ], 'LAUDO' => [ 0 => '0027', 2 => '30027', 3 => '0027', ], 'DADOS_DO_VEICULO' => [ 0 => '0027', 1 => '30027', ] ], 'code' => 201 ]; function r_array_unique($array) { $hasChildren = false; foreach ($array as &$item) { if (is_array($item)) { $hasChildren = true; $item = r_array_unique($item); } } return $hasChildren ? $array : array_unique($array); } var_export(r_array_unique($array));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'sucesso' => array ( 'LAUDO_VISTORIA' => array ( 0 => '0027', 2 => '30027', ), 'LAUDO' => array ( 0 => '0027', 2 => '30027', ), 'DADOS_DO_VEICULO' => array ( 0 => '0027', 1 => '30027', ), ), 'code' => 201, )

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