Doc #78645 [Opn->Csd]: Upgrading notes are missing a note about default empty objects

From: Date: Thu, 07 Nov 2019 10:49:41 +0000
Subject: Doc #78645 [Opn->Csd]: Upgrading notes are missing a note about default empty objects
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17052@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78645&edit=1

 ID:                 78645
 Updated by:         nikic@php.net
 Reported by:        phofstetter at sensational dot ch
 Summary:            Upgrading notes are missing a note about default
                     empty objects
-Status:             Open
+Status:             Closed
 Type:               Documentation Problem
 Package:            Documentation problem
 Operating System:   macOS, Linux
 PHP Version:        7.4.0RC3
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

Note added in https://github.com/php/php-src/commit/d3d85cbcc189f3e2322f656534d093e263b80e2e.


Previous Comments:
------------------------------------------------------------------------
[2019-10-13 15:10:38] cmb@php.net

Well, this has be treated as bug(-fix)[1], and as such has only a
mention in NEWS.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=e63febb1c772e15c1da891f00e3a343090e43c67>

------------------------------------------------------------------------
[2019-10-08 12:16:25] phofstetter at sensational dot ch

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

------------------------------------------------------------------------
[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)

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