"bye" )), array( 2 => true ) ); test( array_map_keys_vals( "strlen", "is_string", array( "hi" => "bye", "hmm" => 17, "!" => false ) ), array( 2 => true, 3 => false, 1 => false ) ); echo "\nstripslashes_deep-test: test flat values"; test( stripslashes_deep( NULL ), NULL ); test( stripslashes_deep( true ), true ); test( stripslashes_deep( 7 ), 7 ); test( stripslashes_deep( "hi" ), "hi" ); test( stripslashes_deep( "hi\nbye" ), "hi\nbye" ); test( stripslashes_deep( 'hi\nbye' ), 'hinbye' ); test( stripslashes_deep( 'hi\x\bye' ), 'hixbye' ); echo "\nstripslashes_deep-test: test arrays of size 0,1, non-recursive"; test( stripslashes_deep( array() ), array() ); test( stripslashes_deep( array(7) ), array(7) ); test( stripslashes_deep( array(true) ), array(true) ); test( stripslashes_deep( array("hi") ), array("hi") ); test( stripslashes_deep( array("hi\nbye") ), array("hi\nbye") ); test( stripslashes_deep( array('hi\nbye') ), array('hinbye') ); test( stripslashes_deep( array('hi\x\bye') ), array('hixbye') ); echo "\nstripslashes_deep-test: test arrays of size 2, non-recursive"; test( stripslashes_deep( array(7,true) ), array(7,true) ); test( stripslashes_deep( array("hi",99) ), array("hi",99) ); test( stripslashes_deep( array("hi\nbye",'wh\oa\x') ), array("hi\nbye",'whoax') ); echo "\nstripslashes_deep-test: test recursive arrays"; test( stripslashes_deep( array(array(7)) ), array(array(7)) ); test( stripslashes_deep( array(array(7),array(8,9)) ), array(array(7),array(8,9)) ); test( stripslashes_deep( array(array('sven\x7'),array('ate\y8','nein\z9'))), array(array('svenx7'), array('atey8','neinz9')) ); echo "\nstripslashes_deep-test: test recursive arrays"; test( stripslashes_deep( array(array(7)) ), array(array(7)) ); test( stripslashes_deep( array(array(7),array(8,9)) ), array(array(7),array(8,9)) ); test( stripslashes_deep( array(array('sven\x7'), array('ate\y8','nein\z9'))), array(array('svenx7') , array('atey8', 'neinz9')) ); echo "\nstripslashes_deep-test: test arrays with slashes in keys."; test( stripslashes_deep( array('sven'=>7,'troo'=>true) ), array('sven'=>7,'troo'=>true) ); test( stripslashes_deep( array('sv\en'=>7,'tr\oo'=>true) ), array('sven' =>7,'troo' =>true) ); test( stripslashes_deep( array(array('sv\en'=>7), 'sub\array' => array('ate\y8'=>8,'nein\z9'=>'nein\z9',true=>'tro\oo'))), array(array('sven' =>7), 'subarray' => array('atey8' =>8,'neinz9' =>'neinz9' ,true=>'trooo' )) ); // I was going to make tests where the keys are *entire arrays*, but it turns out that's not allowed in php, hmmph. echo "\n"; ?>