3v4l.org

run code in 300+ PHP versions simultaneously
<?php $information = array("login" => "someUsername", "password" => "somePassword", "card_pin"=>"card_1234", "pin"=>"pin_356", "iin" => "iin_123", "shipping" => array("telephone" => array("value" => "telephone_998")), "cardnumber" => "card_number_876", "customer_id" => "customer_654", "telephone" => "someOtherTelephoneNumber555"); print_r($information); echo "\n\n"; $key_parent = "telephone"; $iterator = new RecursiveIteratorIterator( new RecursiveArrayIterator($information), RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $key => $val) { if($key == $key_parent) { $information[$key] = "**"; } else { if(is_array($val)) { //echo "$key:\n"; foreach($val as $k => $v) { if($k == $key_parent) $val[$k] = "**"; } } // else { // echo "$key => $val\n"; // } } } print_r($information);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [login] => someUsername [password] => somePassword [card_pin] => card_1234 [pin] => pin_356 [iin] => iin_123 [shipping] => Array ( [telephone] => Array ( [value] => telephone_998 ) ) [cardnumber] => card_number_876 [customer_id] => customer_654 [telephone] => someOtherTelephoneNumber555 ) Array ( [login] => someUsername [password] => somePassword [card_pin] => card_1234 [pin] => pin_356 [iin] => iin_123 [shipping] => Array ( [telephone] => Array ( [value] => telephone_998 ) ) [cardnumber] => card_number_876 [customer_id] => customer_654 [telephone] => ** )

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:
29.48 ms | 403 KiB | 8 Q