php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75682 Undocumented PHP 7.2 BC break
Submitted: 2017-12-14 05:30 UTC Modified: 2017-12-14 22:58 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: glenn at codeacious dot com Assigned:
Status: Verified Package: Documentation problem
PHP Version: 7.2.0 OS:
Private report: No CVE-ID: None
 [2017-12-14 05:30 UTC] glenn at codeacious dot com
Description:
------------
---
From manual page: http://www.php.net/migration72.incompatible
---
PHP 7.2 seems to be applying a stricter comparison between the parameter types of an overridden method and its superclass method signature.

This is causing errors like this when they didn't occur under 7.1:

  PHP Fatal error: Declaration of SubClass::foo() must be compatible with SuperClass::foo()

Examples are being discussed here:
https://www.drupal.org/project/drupal/issues/2923015
https://github.com/zendframework/zend-mvc/issues/266


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-14 22:58 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2017-12-14 22:58 UTC] cmb@php.net
This behavioral change has been introduced in commit b67eb34[1] as
fix for bug #73987.  The bugfix targeted PHP 7.1.2 and 7.2.0, but
has been reverted in the PHP-7.1 branch[2] before PHP 7.1.2 has
been released.  I suppose this has been done for BC reasons, and
as such it would need an entry in UPGRADING and consequently in
the migration guide.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b67eb3440bb244adf6957bf2c68aeeaa6efc8c8d>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=49e9ae1fc1b5a4b0404135d1827ed64a1481d623>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 17:01:27 2024 UTC