diff options
Diffstat (limited to 'tests/executor/memory_limit.phpt')
| -rw-r--r-- | tests/executor/memory_limit.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/executor/memory_limit.phpt b/tests/executor/memory_limit.phpt new file mode 100644 index 0000000..404ab19 --- /dev/null +++ b/tests/executor/memory_limit.phpt | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | --TEST-- | ||
| 2 | memory_limit test: set suhosin hard_limit to normal limit | ||
| 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=0 | ||
| 8 | suhosin.log.syslog=0 | ||
| 9 | suhosin.log.script=0 | ||
| 10 | suhosin.log.sapi=2 | ||
| 11 | --FILE-- | ||
| 12 | <?php | ||
| 13 | ini_set("memory_limit", "13M"); echo ini_get("memory_limit"), "\n"; | ||
| 14 | ini_set("memory_limit", "14M"); echo ini_get("memory_limit"), "\n"; | ||
| 15 | ini_set("memory_limit", "15M"); echo ini_get("memory_limit"), "\n"; | ||
| 16 | ini_set("memory_limit", "16M"); echo ini_get("memory_limit"), "\n"; | ||
| 17 | ini_set("memory_limit", "17M"); echo ini_get("memory_limit"), "\n"; | ||
| 18 | ini_set("memory_limit", "18M"); echo ini_get("memory_limit"), "\n"; | ||
| 19 | ?> | ||
| 20 | --EXPECTF-- | ||
| 21 | 13M | ||
| 22 | 14M | ||
| 23 | 15M | ||
| 24 | 16M | ||
| 25 | ALERT - script tried to increase memory_limit to 17825792 bytes which is above the allowed value (attacker 'REMOTE_ADDR not set', file '%s', line 6) | ||
| 26 | 16M | ||
| 27 | ALERT - script tried to increase memory_limit to 18874368 bytes which is above the allowed value (attacker 'REMOTE_ADDR not set', file '%s', line 7) | ||
| 28 | 16M | ||
| 29 | |||
