1--TEST-- 2References to objects for which Serializable::serialize() returned NULL should use N; 3--FILE-- 4<?php 5 6class NotSerializable implements Serializable { 7 public function serialize() { 8 return null; 9 } 10 11 public function unserialize($serialized) { 12 } 13} 14 15$obj = new NotSerializable(); 16$data = [$obj, $obj]; 17var_dump($s = serialize($data)); 18var_dump(unserialize($s)); 19 20?> 21--EXPECTF-- 22Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d 23string(18) "a:2:{i:0;N;i:1;N;}" 24array(2) { 25 [0]=> 26 NULL 27 [1]=> 28 NULL 29} 30