Doc #75466 [Ver->Csd]: Undocumented Backward Compatibility Break from 7.0 to 7.1

From: Date: Thu, 13 Aug 2020 12:00:11 +0000
Subject: Doc #75466 [Ver->Csd]: Undocumented Backward Compatibility Break from 7.0 to 7.1
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17772@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75466&edit=1

 ID:                 75466
 Updated by:         phpdocbot@php.net
 Reported by:        php at bouchery dot com
 Summary:            Undocumented Backward Compatibility Break from 7.0
                     to 7.1
-Status:             Verified
+Status:             Closed
 Type:               Documentation Problem
 Package:            Documentation problem
 Operating System:   Irrelevant
 PHP Version:        Irrelevant
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=af69aee72fc0357346886cfb6f2aa022b3af62de
Log: Fix #75466: Undocumented Backward Compatibility Break from 7.0 to 7.1


Previous Comments:
------------------------------------------------------------------------
[2018-03-12 22:33:29] cmb@php.net

Confirmed: <https://3v4l.org/bsJkj>
The relevant commit: <http://git.php.net/?p=php-src.git;a=commit;h=fe907562ada8929863561b27355e802db4f14a79>

------------------------------------------------------------------------
[2017-10-30 17:07:23] php at bouchery dot com

Description:
------------
---
From manual page: http://www.php.net/migration71.incompatible
---
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:
---------------
<?php
function foo(): int {
   if (false) { 
      return;
   }
}
?>

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



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75466&edit=1


Thread (3 messages)

« previous php.doc.bugs (#17772) next »