php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76501 Funny message with fatal error
Submitted: 2018-06-19 15:52 UTC Modified: 2018-07-04 01:04 UTC
From: dams@php.net Assigned: kalle (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 7.3.0alpha1 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 - 27 = ?
Subscribe to this entry?

 
 [2018-06-19 15:52 UTC] dams@php.net
Description:
------------
Here are two examples of Fatal error, that bears a funny error message.

<?php break 1.0;
PHP Fatal error:  'break' operator accepts only positive numbers

<?php break true;
'break' operator with non-constant operand is no longer supported


Test script:
---------------
<?php break 1.0;

Those are two separate scripts. 

<?php break true;

<?php const A=1; break A;
PHP Fatal error:  'break' operator with non-constant operand is no longer supported

Expected result:
----------------
"only positive numbers" is misleading, and should mention 'only positive integers'.

That would work for "true", and "A" too : "non-constant operand" is misleading too. 




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-04 01:04 UTC] kalle@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c49f0fd9ac4253c959cb90cb8c470c2aadc3ae7b
Log: Fixed bug #76501 (Funny message with fatal error)
 [2018-07-04 01:04 UTC] kalle@php.net
-Status: Open +Status: Closed
 [2018-07-04 01:04 UTC] kalle@php.net
-Assigned To: +Assigned To: kalle
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC