File: memory_limit.phpt

package info (click to toggle)
php-suhosin 0.9.12-1etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 596 kB
  • ctags: 745
  • sloc: ansic: 7,576; makefile: 100; sh: 34; php: 15
file content (29 lines) | stat: -rw-r--r-- 1,080 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
memory_limit test: set suhosin hard_limit to normal limit
--SKIPIF--
<?php if (!function_exists("memory_get_usage")) print "skip PHP not compiled with memory_limit support"; ?>
--INI--
memory_limit=16M
suhosin.memory_limit=0
suhosin.log.syslog=0
suhosin.log.script=0
suhosin.log.sapi=2
--FILE--
<?php
    ini_set("memory_limit", "13M"); echo ini_get("memory_limit"), "\n";
    ini_set("memory_limit", "14M"); echo ini_get("memory_limit"), "\n";
    ini_set("memory_limit", "15M"); echo ini_get("memory_limit"), "\n";
    ini_set("memory_limit", "16M"); echo ini_get("memory_limit"), "\n";
    ini_set("memory_limit", "17M"); echo ini_get("memory_limit"), "\n";
    ini_set("memory_limit", "18M"); echo ini_get("memory_limit"), "\n";
?>
--EXPECTF--
13M
14M
15M
16M
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)
16M
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)
16M