4 * This is unserializing an intentionally bad (but technically valid) string
5 * to test that values that were overwritten during unserialization can still
6 * be safely referenced with the R format.
8 * We may overwrite array elements (if have multiple entries with the same key)
9 * and object properties (if we have multiple entries for the same property).
11 * If we overwrite these values, any reference to the element / property will
12 * return the latest value, but we also have ref IDs for the old value as a
13 * top-level item, so we can't destroy any values until the end.
16 function test_overwritten_array_element($i) {
20 'i:0;O:8:"stdClass":1:{' .
30 function test_overwritten_property_value($i) {
32 'O:8:"stdClass":3:{' .
34 'i:0;O:8:"stdClass":1:{' .
46 for ($i = 1; $i < 6; $i++
) {
47 print("\n=================================\n");
48 print("Iteration $i\n");
49 test_overwritten_array_element($i);
50 test_overwritten_property_value($i);