1--TEST-- 2Test serialize() & unserialize() functions: error conditions - wrong number of args. 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 16echo "*** Testing serialize()/unserialize() : error conditions ***\n"; 17 18// Zero arguments 19var_dump( serialize() ); 20var_dump( unserialize() ); 21 22//Test serialize with one more than the expected number of arguments 23var_dump( serialize(1,2) ); 24var_dump( unserialize(1,2,3) ); 25 26echo "Done"; 27?> 28--EXPECTF-- 29*** Testing serialize()/unserialize() : error conditions *** 30 31Warning: serialize() expects exactly 1 parameter, 0 given in %s on line 16 32NULL 33 34Warning: unserialize() expects at least 1 parameter, 0 given in %s on line 17 35bool(false) 36 37Warning: serialize() expects exactly 1 parameter, 2 given in %s on line 20 38NULL 39 40Warning: unserialize() expects at most 2 parameters, 3 given in %s on line 21 41bool(false) 42Done 43