|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-09-08 09:20 UTC] yohgaki@php.net
-Summary: Wrong line number for E_NOTICE
+Summary: Wrong line number for E_NOTICE -
undefined constant in class
-Package: *General Issues
+Package: Scripting Engine problem
-Operating System: Linux
+Operating System: Any
-PHP Version: 5.6.13
+PHP Version: Any
[2015-09-08 09:20 UTC] yohgaki@php.net
[2015-09-08 13:54 UTC] bwoebi@php.net
[2017-05-19 10:58 UTC] requinix@php.net
-Status: Open
+Status: Verified
[2018-03-26 09:41 UTC] yohgaki@php.net
[2018-03-26 10:07 UTC] nikic@php.net
[2018-03-26 13:47 UTC] yohgaki@php.net
[2018-03-26 13:50 UTC] yohgaki@php.net
[2020-11-06 16:56 UTC] php4fan at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
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