Date: 10/23/02
- Next message: none <email protected>: "[PHP-DOC] #18129 [Com]: Installation PHP 4.2.X with Apache 2.0.x"
- Previous message: Xiao shengwen: "[PHP-DOC] cvs: phpdoc /en/reference/oracle/functions ora-commitoff.xml ora-commiton.xml ora-do.xml ora-exec.xml ora-logoff.xml ora-rollback.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 20035
Updated by: hholzgra <email protected>
Reported By: befletch <email protected>
-Status: Bogus
+Status: Assigned
-Bug Type: Scripting Engine problem
+Bug Type: Documentation problem
Operating System: OpenBSD 3.1
PHP Version: 4.2.3
-Assigned To:
+Assigned To: hholzgra
Previous Comments:
------------------------------------------------------------------------
[2002-10-23 00:44:20] derick <email protected>
Your kernel strips the first line, and so PHP sees the last 3 lines. As
it doesn't know that the kernel stripped the first shebang line it's
obvious that your line 3 reports line 2.
Derick
------------------------------------------------------------------------
[2002-10-22 20:25:37] befletch <email protected>
Excuse me, but I don't understand why this isn't a bug. The only
reference to __LINE__ I can find in the documentation is here:
http://www.php.net/manual/en/language.constants.php
I can find nothing that suggests it is reasonable that __LINE__ counts
are off by one when used in #! prefixed command line scripts, (but not
in other uses) and I can see no reason why this would be considered
reasonable behaviour.
Can someone give me at least a 1 sentence explanation instead of just
hitting the 'quick-fix' RTFM button?
------------------------------------------------------------------------
[2002-10-22 19:39:04] iliaa <email protected>
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2002-10-22 19:34:54] befletch <email protected>
The built-in variable __LINE__ undercounts by 1 on command-line scripts
that begin with a #!path-to-php line. For example:
#!/usr/local/bin/php -q
<?php
echo "Line 3 reports ".__LINE__."\n";
?>
This script will output:
Line 3 reports 2
This issue also applies to (at least) some other 4.1+ releases.
------------------------------------------------------------------------
-- Edit this bug report at http://bugs.php.net/?id=20035&edit=1-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: none <email protected>: "[PHP-DOC] #18129 [Com]: Installation PHP 4.2.X with Apache 2.0.x"
- Previous message: Xiao shengwen: "[PHP-DOC] cvs: phpdoc /en/reference/oracle/functions ora-commitoff.xml ora-commiton.xml ora-do.xml ora-exec.xml ora-logoff.xml ora-rollback.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

