ofs | hex dump | ascii |
---|
0000 | 2d 2d 54 45 53 54 2d 2d 0a 61 72 72 61 79 5f 77 61 6c 6b 5f 72 65 63 75 72 73 69 76 65 28 29 20 | --TEST--.array_walk_recursive(). |
0020 | 61 6e 64 20 6f 62 6a 65 63 74 73 0a 2d 2d 46 49 4c 45 2d 2d 0a 3c 3f 70 68 70 0a 0a 66 75 6e 63 | and.objects.--FILE--.<?php..func |
0040 | 74 69 6f 6e 20 77 61 6c 6b 28 24 6b 65 79 2c 20 24 76 61 6c 75 65 29 20 7b 0a 20 20 20 20 76 61 | tion.walk($key,.$value).{.....va |
0060 | 72 5f 64 75 6d 70 28 24 76 61 6c 75 65 2c 20 24 6b 65 79 29 3b 0a 7d 0a 0a 63 6c 61 73 73 20 74 | r_dump($value,.$key);.}..class.t |
0080 | 65 73 74 20 7b 0a 20 20 20 20 70 72 69 76 61 74 65 20 24 76 61 72 5f 70 72 69 20 3d 20 22 74 65 | est.{.....private.$var_pri.=."te |
00a0 | 73 74 5f 70 72 69 76 61 74 65 22 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 76 61 72 5f | st_private";.....protected.$var_ |
00c0 | 70 72 6f 20 3d 20 22 74 65 73 74 5f 70 72 6f 74 65 63 74 65 64 22 3b 0a 20 20 20 20 70 75 62 6c | pro.=."test_protected";.....publ |
00e0 | 69 63 20 24 76 61 72 5f 70 75 62 20 3d 20 22 74 65 73 74 5f 70 75 62 6c 69 63 22 3b 0a 7d 0a 0a | ic.$var_pub.=."test_public";.}.. |
0100 | 24 73 74 64 63 6c 61 73 73 20 3d 20 6e 65 77 20 73 74 64 63 6c 61 73 73 3b 0a 24 73 74 64 63 6c | $stdclass.=.new.stdclass;.$stdcl |
0120 | 61 73 73 2d 3e 66 6f 6f 20 3d 20 22 66 6f 6f 22 3b 0a 24 73 74 64 63 6c 61 73 73 2d 3e 62 61 72 | ass->foo.=."foo";.$stdclass->bar |
0140 | 20 3d 20 22 62 61 72 22 3b 0a 61 72 72 61 79 5f 77 61 6c 6b 5f 72 65 63 75 72 73 69 76 65 28 24 | .=."bar";.array_walk_recursive($ |
0160 | 73 74 64 63 6c 61 73 73 2c 20 22 77 61 6c 6b 22 29 3b 0a 0a 24 74 20 3d 20 6e 65 77 20 74 65 73 | stdclass,."walk");..$t.=.new.tes |
0180 | 74 3b 0a 61 72 72 61 79 5f 77 61 6c 6b 5f 72 65 63 75 72 73 69 76 65 28 24 74 2c 20 22 77 61 6c | t;.array_walk_recursive($t,."wal |
01a0 | 6b 22 29 3b 0a 0a 24 76 61 72 20 3d 20 61 72 72 61 79 28 29 3b 0a 61 72 72 61 79 5f 77 61 6c 6b | k");..$var.=.array();.array_walk |
01c0 | 5f 72 65 63 75 72 73 69 76 65 28 24 76 61 72 2c 20 22 77 61 6c 6b 22 29 3b 0a 24 76 61 72 20 3d | _recursive($var,."walk");.$var.= |
01e0 | 20 22 22 3b 0a 74 72 79 20 7b 0a 20 20 20 20 61 72 72 61 79 5f 77 61 6c 6b 5f 72 65 63 75 72 73 | ."";.try.{.....array_walk_recurs |
0200 | 69 76 65 28 24 76 61 72 2c 20 22 77 61 6c 6b 22 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 | ive($var,."walk");.}.catch.(Type |
0220 | 45 72 72 6f 72 20 24 65 29 20 7b 0a 20 20 20 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 | Error.$e).{.....echo.$e->getMess |
0240 | 61 67 65 28 29 2c 20 22 5c 6e 22 3b 0a 7d 0a 0a 65 63 68 6f 20 22 44 6f 6e 65 5c 6e 22 3b 0a 3f | age(),."\n";.}..echo."Done\n";.? |
0260 | 3e 0a 2d 2d 45 58 50 45 43 54 2d 2d 0a 73 74 72 69 6e 67 28 33 29 20 22 66 6f 6f 22 0a 73 74 72 | >.--EXPECT--.string(3)."foo".str |
0280 | 69 6e 67 28 33 29 20 22 66 6f 6f 22 0a 73 74 72 69 6e 67 28 33 29 20 22 62 61 72 22 0a 73 74 72 | ing(3)."foo".string(3)."bar".str |
02a0 | 69 6e 67 28 33 29 20 22 62 61 72 22 0a 73 74 72 69 6e 67 28 31 33 29 20 22 00 74 65 73 74 00 76 | ing(3)."bar".string(13).".test.v |
02c0 | 61 72 5f 70 72 69 22 0a 73 74 72 69 6e 67 28 31 32 29 20 22 74 65 73 74 5f 70 72 69 76 61 74 65 | ar_pri".string(12)."test_private |
02e0 | 22 0a 73 74 72 69 6e 67 28 31 30 29 20 22 00 2a 00 76 61 72 5f 70 72 6f 22 0a 73 74 72 69 6e 67 | ".string(10).".*.var_pro".string |
0300 | 28 31 34 29 20 22 74 65 73 74 5f 70 72 6f 74 65 63 74 65 64 22 0a 73 74 72 69 6e 67 28 37 29 20 | (14)."test_protected".string(7). |
0320 | 22 76 61 72 5f 70 75 62 22 0a 73 74 72 69 6e 67 28 31 31 29 20 22 74 65 73 74 5f 70 75 62 6c 69 | "var_pub".string(11)."test_publi |
0340 | 63 22 0a 61 72 72 61 79 5f 77 61 6c 6b 5f 72 65 63 75 72 73 69 76 65 28 29 3a 20 41 72 67 75 6d | c".array_walk_recursive():.Argum |
0360 | 65 6e 74 20 23 31 20 28 24 61 72 72 61 79 29 20 6d 75 73 74 20 62 65 20 6f 66 20 74 79 70 65 20 | ent.#1.($array).must.be.of.type. |
0380 | 61 72 72 61 79 2c 20 73 74 72 69 6e 67 20 67 69 76 65 6e 0a 44 6f 6e 65 0a | array,.string.given.Done. |