|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75466 Undocumented Backward Compatibility Break from 7.0 to 7.1
Submitted: 2017-10-30 17:07 UTC Modified: 2018-03-12 22:33 UTC
Avg. Score:3.6 ± 1.3
Reproduced:5 of 6 (83.3%)
Same Version:5 (100.0%)
Same OS:1 (20.0%)
From: php at bouchery dot com Assigned:
Status: Verified Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: php at bouchery dot com
New email:
PHP Version: OS:


 [2017-10-30 17:07 UTC] php at bouchery dot com
From manual page:
When "return" without value in a function using return type into PHP 7.0, this will not generate fatale if "return" is not executed.

When migrating to PHP 7.1, it will generate a compilation error "Fatal error: A function with return type must return a value" even if "return" is not executed.

Test script:
function foo(): int {
   if (false) { 

Replace the "false" condition by what you want, never or rarely called.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 22:33 UTC]
-Status: Open +Status: Verified
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 05:01:23 2020 UTC