1--TEST-- 2(un)serializing __PHP_Incomplete_Class instance edge case 3--FILE-- 4<?php 5 6$serialized = 'O:8:"Missing_":1:{s:33:"__PHP_Incomplete_Class_Name' . "\0" . 'other";i:123;}'; 7ob_start(); 8$o = unserialize($serialized); 9var_dump($o); 10$reserialized = serialize($o); 11var_dump(unserialize($reserialized)); 12// Pretty print null bytes 13echo str_replace("\0", "\\0", ob_get_clean()); 14 15// The serialization should have a property count of 1 and a property set with 1 element. 16var_export($reserialized); 17echo "\n"; 18?> 19--EXPECT-- 20object(__PHP_Incomplete_Class)#1 (2) { 21 ["__PHP_Incomplete_Class_Name"]=> 22 string(8) "Missing_" 23 ["__PHP_Incomplete_Class_Name\0other"]=> 24 int(123) 25} 26object(__PHP_Incomplete_Class)#2 (2) { 27 ["__PHP_Incomplete_Class_Name"]=> 28 string(8) "Missing_" 29 ["__PHP_Incomplete_Class_Name\0other"]=> 30 int(123) 31} 32'O:8:"Missing_":1:{s:33:"__PHP_Incomplete_Class_Name' . "\0" . 'other";i:123;}' 33