1--TEST--
2php_strip_whitespace() tests
3--FILE--
4<?php
5
6$filename = __DIR__."/php_strip_whitespace.dat";
7
8var_dump(php_strip_whitespace($filename));
9
10$data = '/* test comment */';
11file_put_contents($filename, $data);
12var_dump(php_strip_whitespace($filename));
13
14$data = '<?php /* test comment */ ?>';
15file_put_contents($filename, $data);
16var_dump(php_strip_whitespace($filename));
17
18$data = '<?php
19/* test class */
20class test {
21
22    /* function foo () */
23
24    function foo () /* {{{ */
25    {
26
27
28        echo $var; //does not exist
29    }
30    /* }}} */
31
32}
33?>';
34
35file_put_contents($filename, $data);
36var_dump(php_strip_whitespace($filename));
37
38@unlink($filename);
39echo "Done\n";
40?>
41--EXPECTF--
42Warning: php_strip_whitespace(%sphp_strip_whitespace.dat): Failed to open stream: No such file or directory in %s on line %d
43string(0) ""
44string(18) "/* test comment */"
45string(9) "<?php  ?>"
46string(55) "<?php
47 class test { function foo () { echo $var; } } ?>"
48Done
49