1--TEST-- 2Test for Github issue #93 (double and long overflow) 3--SKIPIF-- 4<?php include "skipif.inc";?> 5--FILE-- 6<?php 7include dirname (__FILE__) . '/config.inc'; 8$m = memc_get_instance (array ( 9 Memcached::OPT_COMPRESSION => false 10 )); 11 12function testOverflow($m, $value) { 13 $m->delete('overflow'); 14 if (true !== $m->set('overflow', $value)) { 15 echo "Error storing 'overflow' variable\n"; 16 return false; 17 } 18 19 if (true !== $m->prepend('overflow', str_repeat('0', 128))) { 20 echo "Error prepending key\n"; 21 return false; 22 } 23 24 $v = @$m->get('overflow'); 25 if ($v !== $value) { 26 // At least it doesn't segfault, so we're happy for now 27 // echo "Error receiving 'overflow' variable\n"; 28 // return false; 29 return true; 30 } 31 32 return true; 33} 34 35if (!testOverflow($m, 10)) { 36 return; 37} 38 39if (!testOverflow($m, 9.09)) { 40 return; 41} 42 43echo "OK\n"; 44?> 45--EXPECT-- 46OK