1--TEST--
2Test str_pad() function : usage variations - unexpected large value for '$pad_length' argument
3--INI--
4memory_limit=128M
5--SKIPIF--
6<?php
7if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
8if (getenv("USE_ZEND_ALLOC") === "0") {
9    die("skip Zend MM disabled");
10}
11?>
12--FILE--
13<?php
14/* Test str_pad() function: with unexpected inputs for '$pad_length'
15 *  and expected type for '$input'
16*/
17
18echo "*** Testing str_pad() function: with large value for for 'pad_length' argument ***\n";
19
20//defining '$input' argument
21$input = "Test string";
22$pad_length = PHP_INT_MAX - 16; /* zend_string header is 16 bytes */
23var_dump( str_pad($input, $pad_length) );
24
25?>
26--EXPECTF--
27*** Testing str_pad() function: with large value for for 'pad_length' argument ***
28
29Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
30