Doc #78645 [Opn]: Upgrading notes are missing a note about default empty objects
Edit report at https://bugs.php.net/bug.php?id=78645&edit=1
ID: 78645
User updated by: phofstetter at sensational dot ch
Reported by: phofstetter at sensational dot ch
Summary: Upgrading notes are missing a note about default
empty objects
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: macOS, Linux
PHP Version: 7.4.0RC3
Block user comment: N
Private report: N
New Comment:
when I said
> Prior to 7,4 only the second line of the test script would throw a warning
I meant
> Prior to 7,4 only the *first* line of the test script would throw a warning
Previous Comments:
------------------------------------------------------------------------
[2019-10-08 12:13:30] phofstetter at sensational dot ch
Description:
------------
When testing our codebase with PHP 7.4, I noticed that some third-party library (Smarty) was relying
on broken behavior of PHP versions prior to 7.4 that was apparently fixed in 7.4:
Prior to 7,4 only the second line of the test script would throw a warning. In 7.4, both lines throw
a warning.
<?php
$foo=null; $foo->bar = "baz"; // does throw warning in <7.4
$foo=null; $foo->bar["baz"] = "baz"; // doesn't throw warning in
<7.4
I'm not asking for the old obviously broken behavior to be restored, but seeing that some still
somewhat widely used piece of software is relying on this bug, it may make sense to add a note to
the UPGRADING.txt file.
Test script:
---------------
<?php
$foo=null; $foo->bar = "baz"; // does throw warning
$foo=null; $foo->bar["baz"] = "baz"; // doesn't throw warning
Expected result:
----------------
one warning
Actual result:
--------------
two warnings
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78645&edit=1
Thread (4 messages)