php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70931 Two errors messages are in conflict
Submitted: 2015-11-17 20:52 UTC Modified: 2015-11-29 06:26 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dams@php.net Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 7.0.0RC7 OS: Any
Private report: No CVE-ID: None
 [2015-11-17 20:52 UTC] dams@php.net
Description:
------------
It is possible to have the following errors : 

"Encoding declaration pragma must be the very first statement in the script"
And Then : 
"Namespace declaration statement has to be the very first statement in the script"


Is is also possible to have the following, in place of the first statement :
"strict_types declaration must be the very first statement in the script"

In fact, namespace declaration should happen in first in the script, but AFTER
encoding or strict_types declare calls. 



Expected result:
----------------
All C code is in Zend/zend_compile.c file.

Line 4498 for "Encoding declaration pragma "
Line 4505 for "strict_types declaration pragma "

line 5827 for "Namespace declaration statement "

I suggest the second error message is updated and mention the 'declare' (see patch)


Patches

errorMessage (last revision 2015-11-17 20:54 UTC by damien dot seguy at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-19 03:21 UTC] laruence@php.net
I am not sure what message will be best, but " or the second after a declare call" seems not very good. like:

declare()...
declare()...
namespace?
 [2015-11-19 03:22 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-11-19 11:01 UTC] dams@php.net
New suggestion : 

" or after any declare call"
 [2015-11-29 04:22 UTC] php-bugs at lists dot php dot net
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 "Re-Opened". Thank you.
 [2015-11-29 06:26 UTC] requinix@php.net
-Status: No Feedback +Status: Open
 [2015-11-29 07:44 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1f65006fce2357d80f6ea29c4527e634450a6893
Log: Fixed bug #70931 (Two errors messages are in conflict)
 [2015-11-29 07:44 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:35 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1f65006fce2357d80f6ea29c4527e634450a6893
Log: Fixed bug #70931 (Two errors messages are in conflict)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 22:01:27 2024 UTC