diff options
Diffstat (limited to 'tests/executor/memory_limit_negative.phpt')
| -rw-r--r-- | tests/executor/memory_limit_negative.phpt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/executor/memory_limit_negative.phpt b/tests/executor/memory_limit_negative.phpt new file mode 100644 index 0000000..7fad546 --- /dev/null +++ b/tests/executor/memory_limit_negative.phpt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | --TEST-- | ||
| 2 | memory_limit test: trying to set memory_limit to a negative value | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!function_exists("memory_get_usage")) print "skip PHP not compiled with memory_limit support"; ?> | ||
| 5 | --INI-- | ||
| 6 | memory_limit=16M | ||
| 7 | suhosin.memory_limit=17M | ||
| 8 | suhosin.log.syslog=0 | ||
| 9 | suhosin.log.script=0 | ||
| 10 | suhosin.log.sapi=2 | ||
| 11 | --FILE-- | ||
| 12 | <?php | ||
| 13 | ini_set("memory_limit", "-200000"); echo ini_get("memory_limit"), "\n"; | ||
| 14 | ?> | ||
| 15 | --EXPECTF-- | ||
| 16 | ALERT - script tried to disable memory_limit by setting it to a negative value -%d bytes which is not allowed (attacker 'REMOTE_ADDR not set', file '%s', line 2) | ||
| 17 | 16M | ||
| 18 | |||
