php-src/ext/standard/tests/array/array_walk_rec_objects.phpt
Steph Fox 833f4150a1 - killed off UEXPECT
- could someone please fix var_export2.phpt? NUL is corrupted, can't fix here
2008-05-26 23:36:10 +00:00

45 lines
854 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
array_walk_recursive() and objects
--FILE--
<?php
function walk($key, $value) {
var_dump($value, $key);
}
class test {
private $var_pri = "test_private";
protected $var_pro = "test_protected";
public $var_pub = "test_public";
}
$stdclass = new stdclass;
$stdclass->foo = "foo";
$stdclass->bar = "bar";
array_walk_recursive($stdclass, "walk");
$t = new test;
array_walk_recursive($t, "walk");
$var = array();
array_walk_recursive($var, "walk");
$var = "";
array_walk_recursive($var, "walk");
echo "Done\n";
?>
--EXPECTF--
unicode(3) "foo"
unicode(3) "foo"
unicode(3) "bar"
unicode(3) "bar"
unicode(13) "testvar_pri"
unicode(12) "test_private"
unicode(10) "*var_pro"
unicode(14) "test_protected"
unicode(7) "var_pub"
unicode(11) "test_public"
Warning: array_walk_recursive(): The argument should be an array in %s on line %d
Done