3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $type = 'product'; $services = array( 'Client'=>array( 'methods'=>array( 'Get Activity'=>array('name'=>'get_activity'), 'Get Client List'=>array('name'=>'get_client_list'), 'Get Stats'=>array('name'=>'get_stats', 'methods'=>array('Source Call History'=>array('name'=>'source_call_history'), 'Source Product Summary'=>array('name'=>'source_product_summary')) ), 'Update Activty'=>array('name'=>'update_activity') ) ), 'Source'=>array( 'methods'=>array( 'Get Source List'=>array('name'=>'get_source_list'), 'Get Source Contract List'=>array('name'=>'get_sourcecontract_list'), 'Get Stats'=>array( 'name'=>'get_stats', 'methods'=>array( 'Source Call History'=>array('name'=>'source_call_history'), 'Source Campaign Details'=>array('name'=>'source_campaign_details'), 'Source Campaign Summary'=>array('name'=>'source_campaign_summary'), 'Source Contact Lookup'=>array('name'=>'source_contact_lookup'), 'Source Live Calls'=>array('name'=>'source_live_calls'), 'Source Passthrough Lookup'=>array('name'=>'source_passthrough_lookup'), 'Source Product Summary'=>array('name'=>'source_product_summary') ) ) ) ) ); if ($type) {//root switch($type){ case 'product': print_r(array_keys($services)); break; case 'client': case 'source': print_r(array_keys($services[$type]['methods']['Get Stats']['methods'])); break; default: print_r($services); } } else { print_r($services); }
Output for 4.3.0 - 7.2.0
Array ( [0] => Client [1] => Source )