3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menu = [ 1 => [ 'menuName' => 'Apps', 'menuUrl' => '/Apps', 'Invisible_Mode' => '', 'subMenu' => [ [ 'subMenuName' => 'Collaboration', 'subMenuUrl' => '/Apps/Collaboration', 'subitemCount' => 5, 'Invisible_Mode' => '' ], [ 'subMenuName' => 'Sales', 'subMenuUrl' => '/Apps/Sales', 'subitemCount' => 11, 'Invisible_Mode' => '' ], [ 'subMenuName' => 'Project Management', 'subMenuUrl' => '/Apps/Project-Management', 'subitemCount' => 5, 'Invisible_Mode' => '' ], [ 'subMenuName' => 'Human Resources', 'subMenuUrl' => '/Apps/Human-Resources', 'subitemCount' => 7, 'Invisible_Mode' => '' ], [ 'subMenuName' => 'Marketing', 'subMenuUrl' => '/Apps/Marketing', 'subitemCount' => 8, 'Invisible_Mode' => '' ] ] ] ]; var_export( array_map( function ($set) { $set['subMenu'] = array_column($set['subMenu'], null, 'subMenuName'); return $set; }, $menu ) );
Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
array ( 1 => array ( 'menuName' => 'Apps', 'menuUrl' => '/Apps', 'Invisible_Mode' => '', 'subMenu' => array ( 'Collaboration' => array ( 'subMenuName' => 'Collaboration', 'subMenuUrl' => '/Apps/Collaboration', 'subitemCount' => 5, 'Invisible_Mode' => '', ), 'Sales' => array ( 'subMenuName' => 'Sales', 'subMenuUrl' => '/Apps/Sales', 'subitemCount' => 11, 'Invisible_Mode' => '', ), 'Project Management' => array ( 'subMenuName' => 'Project Management', 'subMenuUrl' => '/Apps/Project-Management', 'subitemCount' => 5, 'Invisible_Mode' => '', ), 'Human Resources' => array ( 'subMenuName' => 'Human Resources', 'subMenuUrl' => '/Apps/Human-Resources', 'subitemCount' => 7, 'Invisible_Mode' => '', ), 'Marketing' => array ( 'subMenuName' => 'Marketing', 'subMenuUrl' => '/Apps/Marketing', 'subitemCount' => 8, 'Invisible_Mode' => '', ), ), ), )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
74.95 ms | 408 KiB | 5 Q