1--TEST-- 2Serialize() must return a string or NULL 3--FILE-- 4<?php 5/* Prototype : proto string serialize(mixed variable) 6 * Description: Returns a string representation of variable (which can later be unserialized) 7 * Source code: ext/standard/var.c 8 * Alias to functions: 9 */ 10/* Prototype : proto mixed unserialize(string variable_representation) 11 * Description: Takes a string representation of variable and recreates it 12 * Source code: ext/standard/var.c 13 * Alias to functions: 14 */ 15 16Class C implements Serializable { 17 public function serialize() { 18 return $this; 19 } 20 21 public function unserialize($blah) { 22 } 23} 24 25try { 26 var_dump(serialize(new C)); 27} catch (Exception $e) { 28 echo $e->getMessage(). "\n"; 29} 30 31echo "Done"; 32?> 33--EXPECT-- 34C::serialize() must return a string or NULL 35Done 36