xref: /PHP-7.4/Zend/tests/bug76439.phpt (revision 17afe643)
1--TEST--
2Bug #76439: Don't always strip leading whitespace from heredoc T_ENCAPSED_AND_WHITESPACE tokens
3--FILE--
4<?php
5
6[$one, $two, $three, $four, $five, $six, $seven, $eight, $nine] = [1, 2, 3, 4, 5, 6, 7, 8, 9];
7
8var_dump(<<<BAR
9 $one-
10 BAR);
11
12var_dump(<<<BAR
13 $two -
14 BAR);
15
16var_dump(<<<BAR
17 $three	-
18 BAR);
19
20var_dump(<<<BAR
21 $four-$four
22 BAR);
23
24var_dump(<<<BAR
25 $five-$five-
26 BAR);
27
28var_dump(<<<BAR
29 $six-$six-$six
30 BAR);
31
32var_dump(<<<BAR
33 $seven
34 -
35 BAR);
36
37var_dump(<<<BAR
38 $eight
39  -
40 BAR);
41
42var_dump(<<<BAR
43$nine
44BAR);
45
46var_dump(<<<BAR
47 -
48 BAR);
49
50var_dump(<<<BAR
51  -
52 BAR);
53
54?>
55--EXPECT--
56string(2) "1-"
57string(3) "2 -"
58string(3) "3	-"
59string(3) "4-4"
60string(4) "5-5-"
61string(5) "6-6-6"
62string(3) "7
63-"
64string(4) "8
65 -"
66string(1) "9"
67string(1) "-"
68string(2) " -"
69