summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/wordwrap_memory_limit_win32.phpt
blob: e0e76b5800ce245f7c4c4587f445eb55a4edd341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
No overflow should occur during the memory_limit check for wordwrap()
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN' || PHP_INT_SIZE != 4) die("skip this test is for 32bit Windows platforms only");
if (getenv("USE_ZEND_ALLOC") === "0") die("skip Zend MM disabled");
?>
--INI--
memory_limit=128M
--FILE--
<?php

$str = str_repeat('x', 65534);
$str2 = str_repeat('x', 65535);
wordwrap($str, 1, $str2);

?>
--EXPECTF--
Fatal error: Possible integer overflow in memory allocation (4294901777 + %d) in %s on line %d