xref: /PHP-8.0/sapi/cgi/tests/002.phpt (revision 26dfce7f)
1--TEST--
2defining INI options with -d
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "include.inc";
10
11$php = get_cgi_path();
12reset_env_vars();
13
14$file = __DIR__."/002.test.php";
15
16file_put_contents($file, '<?php var_dump(ini_get("max_execution_time")); ?>');
17
18var_dump(`$php -n -d max_execution_time=111 $file`);
19var_dump(`$php -n -d max_execution_time=500 $file`);
20var_dump(`$php -n -d max_execution_time=500 -d max_execution_time=555 $file`);
21
22file_put_contents($file, '<?php var_dump(ini_get("max_execution_time")); var_dump(ini_get("upload_tmp_dir")); ?>');
23
24var_dump(`$php -n -d upload_tmp_dir=/test/path -d max_execution_time=555 $file`);
25
26unlink($file);
27
28echo "Done\n";
29?>
30--EXPECTF--
31string(%d) "X-Powered-By: PHP/%s
32Content-type: text/html%r; charset=.*|%r
33
34string(3) "111"
35"
36string(%d) "X-Powered-By: PHP/%s
37Content-type: text/html%r; charset=.*|%r
38
39string(3) "500"
40"
41string(%d) "X-Powered-By: PHP/%s
42Content-type: text/html%r; charset=.*|%r
43
44string(3) "555"
45"
46string(%d) "X-Powered-By: PHP/%s
47Content-type: text/html%r; charset=.*|%r
48
49string(3) "555"
50string(10) "/test/path"
51"
52Done
53