1--TEST-- 2Check that SplObjectStorage::unserialize throws exception when numeric value passed 3--CREDITS-- 4PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) 5--FILE-- 6<?php 7 8$data_provider = array( 9 12345, 10 1.2345, 11 PHP_INT_MAX, 12 'x:rubbish', // rubbish after the 'x:' prefix 13 'x:i:2;O:8:"stdClass":0:{},s:5:"value";;m:a:0:{}', 14); 15 16foreach($data_provider as $input) { 17 18 $s = new SplObjectStorage(); 19 20 try { 21 $s->unserialize($input); 22 } catch(UnexpectedValueException $e) { 23 echo $e->getMessage() . PHP_EOL; 24 } 25} 26 27?> 28--EXPECTF-- 29Error at offset %d of %d bytes 30Error at offset %d of %d bytes 31Error at offset %d of %d bytes 32Error at offset %d of %d bytes 33Error at offset %d of %d bytes 34