Bug #54081 [Opn->Dup]: __LINE__ provides unexpected value
| From: | reeze@php.net | Date: | Tue, 03 Mar 2015 03:55:11 +0000 |
| Subject: | Bug #54081 [Opn->Dup]: __LINE__ provides unexpected value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191068@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54081&edit=1
ID: 54081
Updated by: reeze@php.net
Reported by: rmroczk at searshc dot com
Summary: __LINE__ provides unexpected value
-Status: Open
+Status: Duplicate
Type: Bug
Package: CGI/CLI related
Operating System: ubuntu
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Dup of bug https://bugs.php.net/bug.php?id=67741
and been fixed in PHP5.5+
Previous Comments:
------------------------------------------------------------------------
[2011-02-23 18:06:27] rmroczk at searshc dot com
Description:
------------
This issue is very similar to Bug #20035 but the difference is in the #! line.
I am trying to find a way to specify the #! line, including the -d option such that the value of
__LINE__ is correct.
Test script:
---------------
$ php5 -dauto_prepend_file=auto_prepend.php <test.php #correct value of __LINE__
Line: 2
#!/usr/bin/php5 -dauto_prepend_file=auto_prepend.php
Line: 7
$ ./test.php #incorrect value of __LINE__
Line: 3
Line: 6
$ php5 -dauto_prepend_file=auto_prepend.php test.php #incorrect
Line: 3
Line: 6
$ cat auto_prepend.php
<?php
echo "Line: " . __LINE__ . "\n";
?>
$ cat test.php
#!/usr/bin/php5 -dauto_prepend_file=auto_prepend.php
<?php
function function_name() {
}
function function_name2() {
}
echo "Line: " . __LINE__ . "\n";
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54081&edit=1