xref: /PHP-5.3/Zend/tests/nowdoc_015.phpt (revision ddcf7a2f)
1--TEST--
2Test nowdoc and line numbering
3--FILE--
4<?php
5function error_handler($num, $msg, $file, $line, $vars) {
6	echo $line,"\n";
7}
8set_error_handler('error_handler');
9trigger_error("line", E_USER_ERROR);
10$x = <<<EOF
11EOF;
12var_dump($x);
13trigger_error("line", E_USER_ERROR);
14$x = <<<'EOF'
15EOF;
16var_dump($x);
17trigger_error("line", E_USER_ERROR);
18$x = <<<EOF
19test
20EOF;
21var_dump($x);
22trigger_error("line", E_USER_ERROR);
23$x = <<<'EOF'
24test
25EOF;
26var_dump($x);
27trigger_error("line", E_USER_ERROR);
28$x = <<<EOF
29test1
30test2
31
32test3
33
34
35EOF;
36var_dump($x);
37trigger_error("line", E_USER_ERROR);
38$x = <<<'EOF'
39test1
40test2
41
42test3
43
44
45EOF;
46var_dump($x);
47trigger_error("line", E_USER_ERROR);
48echo "ok\n";
49?>
50--EXPECT--
516
52string(0) ""
5310
54string(0) ""
5514
56string(4) "test"
5719
58string(4) "test"
5924
60string(20) "test1
61test2
62
63test3
64
65"
6634
67string(20) "test1
68test2
69
70test3
71
72"
7344
74ok
75