3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paths = array( 20 => array( 'name' => 'Heels', 'path' => '1/2/10/15/20', ), 15 => array( 'name' => 'Sandals', 'path' => '1/2/80/96/15', ), 10 => array( 'name' => 'Trainers', 'path' => '1/2/80/96/10', ), ); arsort($paths); $breadcrumb = (object) array( 'value' => array_keys($paths)[count($paths)-1], 'labels' => implode(' > ', array_column($paths, 'name')) ); var_dump($breadcrumb);

preferences:
33.99 ms | 408 KiB | 5 Q