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