php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80486 Undocumented backward incompatible change between 7.4.8 and 7.4.9
Submitted: 2020-12-04 19:17 UTC Modified: 2020-12-28 14:05 UTC
From: php4fan at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
 [2020-12-04 19:17 UTC] php4fan at gmail dot com
Description:
------------
---
From manual page: https://php.net/migration74.incompatible
---

Something has changed between 7.4.8 and 7.4.9 that affects passing parameters to a function by eference.

Leaving aside the fact that such bc-breaking changes shouldn't be introduced between sub-minor versions (i.e. from x.x.y to x.x.z) to begin with, this change is not documented.

I would expect to find it here:
https://www.php.net/manual/en/migration74.incompatible.php

(given that there is not a section named "migrating from 7.4.8 to 7.4.9)

The script below runs without errors or warnings in all versions <= 7.4.8 (including ancient ones), and causes fatal errors starting from 7.4.9

See https://3v4l.org/SMK9U

Test script:
---------------
<?php

function test(&$value) {
    echo $value; 
}

test(intval(3));

Expected result:
----------------
bc-breaking change should be documented


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-04 19:31 UTC] danack@php.net
Hey Teo,

The migration guide is for migrating between versions that are meant to have changes.

There is also list of bug fixes for each version: https://www.php.net/ChangeLog-7.php#PHP_7_4 but I can't currently see it listed....which is not good.

There should be an entry for it as it is definitely different behaviour, so thanks for reporting it.
 [2020-12-04 22:11 UTC] danack@php.net
Possibly from the fix for bug #79783 
https://github.com/php/php-src/commit/971e5c5186a2a2339b0dbad4f2a057a9deed5aa2

Although your example doesn't crash, it was only working by coincidence, rather than being a safe thing to do.
 [2020-12-05 12:48 UTC] cmb@php.net
Like Dan said, the behavioral change is caused by fixing that bug,
but passing the result of an internal function call to a by-ref
parameter shouldn't have worked in the first place.  I agree that
this should not be documented in the migration guide, but we
rather should improve the documentation of "passing arguments by
reference"[1], which does not even mention that values should not
or must not, respectively, passed to reference parameters.

[1] <https://www.php.net/manual/en/functions.arguments.php#functions.arguments.by-reference>
 [2020-12-28 14:05 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Scripting Engine problem -Assigned To: +Assigned To: cmb
 [2020-12-28 14:07 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=352241
Log: Fix #80486: Undocumented backward incompatible change between 7.4.8 and 7.4.9
 [2020-12-28 14:08 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=ef81c708faf8d64a78c103fca7d53b7f6cdfacce
Log: Fix #80486: Undocumented backward incompatible change between 7.4.8 and 7.4.9
 [2020-12-28 14:08 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-12-28 21:20 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=352256
Log: Fix #80486: Undocumented backward incompatible change between 7.4.8 and 7.4.9
 [2020-12-28 21:25 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=cc33b525be2161b6624e55a1b293ba4be8e55829
Log: Fix #80486: Undocumented backward incompatible change between 7.4.8 and 7.4.9
 [2020-12-30 11:58 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=30f0be248e5dcdc58104e36e2bc53d185eb5e6b8
Log: Fix #80486: Undocumented backward incompatible change between 7.4.8 and 7.4.9
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 23:01:34 2024 UTC