1--TEST-- 2No overflow should occur during the memory_limit check for wordwrap() 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); 6if (getenv("USE_ZEND_ALLOC") === "0") die("skip Zend MM disabled"); 7?> 8--INI-- 9memory_limit=128M 10--FILE-- 11<?php 12 13$str = str_repeat('x', 65534); 14$str2 = str_repeat('x', 65535); 15wordwrap($str, 1, $str2); 16 17?> 18--EXPECTF-- 19Fatal error: %rAllowed memory size of %d bytes exhausted%s\(tried to allocate %d bytes\)|Possible integer overflow in memory allocation \(4294901777 \+ %d\)%r in %s on line %d 20