Bug #70457 [NEW]: Wrong line number for E_NOTICE
| From: | daniel dot jaenecke at sedo dot com | Date: | Tue, 08 Sep 2015 08:47:02 +0000 |
| Subject: | Bug #70457 [NEW]: Wrong line number for E_NOTICE | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-195868@lists.php.net to get a copy of this message | ||
From: daniel dot jaenecke at sedo dot com
Operating system: Linux
PHP version: 5.6.13
Package: *General Issues
Bug Type: Bug
Bug description:Wrong line number for E_NOTICE
Description:
------------
A notice complaining about an undefined constant assigned to a class
property is reported for the wrong line number.
I could reproduce this with the provided snippet for versions 5.3, 5.5
and 5.6
Test script:
---------------
<?php
class MyClass
{
private $var1 = ANOTHER_NONE_EXISTING_CONSTANT;
private $var2 = 1;
}
$obj = new MyClass();
Expected result:
----------------
A notice for the line where the undefined constant is being used, in
this case Notice: Use of undefined constant
NONE_EXISTING_GLOBAL_CONSTANT [â¦] in line 6
Actual result:
--------------
Notice: Use of undefined constant ANOTHER_NONE_EXISTING_CONSTANT -
assumed 'ANOTHER_NONE_EXISTING_CONSTANT' in
/home/daniel/tmp/php-linenumber-bug/code.php on line 11
--
Edit bug report at https://bugs.php.net/bug.php?id=70457&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70457&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70457&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70457&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70457&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70457&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70457&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70457&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70457&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70457&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70457&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70457&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70457&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70457&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70457&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70457&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70457&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70457&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70457&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70457&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70457&r=mysqlcfg