[PHP-DOC] #26582 [NoF-Opn]: HEREDOC linefeed requirement mis-documented

2003-12-18 Thread iwd32900 at yahoo dot com
 ID:   26582
 User updated by:  iwd32900 at yahoo dot com
 Reported By:  iwd32900 at yahoo dot com
-Status:   No Feedback
+Status:   Open
 Bug Type: Documentation problem
 Operating System: Darwin/Mac OS X
 PHP Version:  4.3.4
 New Comment:

No, it doesn't work with \r.

I realize that in some sense, \n is the new 'native' 
linefeed for Mac since OS X is Unix based. This doesn't 
change my opinion that PHP should be linefeed-agnostic, 
so that code can easily be transported from one platform 
to another.


Previous Comments:


[2003-12-18 05:21:18] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





[2003-12-10 09:39:06] [EMAIL PROTECTED]

Does heredoc work for you with \r?



[2003-12-10 09:12:36] iwd32900 at yahoo dot com

Description:

The current manual says this, under the Heredoc 
section in Strings in Types:

-
It's also important to realize that the first character 
before the closing identifier must be a newline as 
defined by your operating system. This is \r on 
Macintosh for example.

If this rule is broken and the closing identifier is not 
clean then it's not considered to be a closing 
identifier and PHP will continue looking for one. If in 
this case a proper closing identifier is not found then 
a parse error will result with the line number being at 
the end of the script.
-

I have two issues with this.
1. This doesn't appear to be true. I'm using the 
entropy.ch distribution of 4.3.4, and it accepts \n as a 
linefeed before the end marker on my Mac.

2. One of the great things about PHP is that it's cross-
platform portable. The interpretter otherwise seems to 
be linefeed-agnostic; it should be here, too. That way, 
I can write my scripts on any platform and distribute 
them to any other, and no one has to worry about 
something as irritating as linefeeds. Just check for any 
of \n, \r, or \r\n before a heredoc terminator. Should 
be really easy, and it will do a lot for making PHP more 
platform independent.

Reproduce code:
---
$heredoc = HEREDOC
Does this cause a parse error?
HEREDOC;
echo $heredoc;

// No, it doesn't

Expected result:

Given what the manual says, this should break since the 
linefeeds are Unix but it was run on a Mac.

The documented behavior isn't the DESIRABLE behavior, 
however. PHP should accept all linefeed types on all 
platforms to promote code portability.

Actual result:
--
The example works just fine on my Mac, actually. It may 
be that the cross-platform behavior is already 
implementd, and just hasn't been documented yet.





-- 
Edit this bug report at http://bugs.php.net/?id=26582edit=1


[PHP-DOC] #26582 [NEW]: HEREDOC linefeed requirement mis-documented

2003-12-10 Thread iwd32900 at yahoo dot com
From: iwd32900 at yahoo dot com
Operating system: Darwin/Mac OS X
PHP version:  4.3.4
PHP Bug Type: Documentation problem
Bug description:  HEREDOC linefeed requirement mis-documented

Description:

The current manual says this, under the Heredoc 
section in Strings in Types:

-
It's also important to realize that the first character 
before the closing identifier must be a newline as 
defined by your operating system. This is \r on 
Macintosh for example.

If this rule is broken and the closing identifier is not 
clean then it's not considered to be a closing 
identifier and PHP will continue looking for one. If in 
this case a proper closing identifier is not found then 
a parse error will result with the line number being at 
the end of the script.
-

I have two issues with this.
1. This doesn't appear to be true. I'm using the 
entropy.ch distribution of 4.3.4, and it accepts \n as a 
linefeed before the end marker on my Mac.

2. One of the great things about PHP is that it's cross-
platform portable. The interpretter otherwise seems to 
be linefeed-agnostic; it should be here, too. That way, 
I can write my scripts on any platform and distribute 
them to any other, and no one has to worry about 
something as irritating as linefeeds. Just check for any 
of \n, \r, or \r\n before a heredoc terminator. Should 
be really easy, and it will do a lot for making PHP more 
platform independent.

Reproduce code:
---
$heredoc = HEREDOC
Does this cause a parse error?
HEREDOC;
echo $heredoc;

// No, it doesn't

Expected result:

Given what the manual says, this should break since the 
linefeeds are Unix but it was run on a Mac.

The documented behavior isn't the DESIRABLE behavior, 
however. PHP should accept all linefeed types on all 
platforms to promote code portability.

Actual result:
--
The example works just fine on my Mac, actually. It may 
be that the cross-platform behavior is already 
implementd, and just hasn't been documented yet.

-- 
Edit bug report at http://bugs.php.net/?id=26582edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26582r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26582r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=26582r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=26582r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26582r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=26582r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=26582r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=26582r=support
Expected behavior:  http://bugs.php.net/fix.php?id=26582r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=26582r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=26582r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=26582r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26582r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=26582r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=26582r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=26582r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26582r=float