Bug #79069 [Com]: Property name concatenation triggers deprecated warning
| From: | bugreports at gmail dot com | Date: | Mon, 06 Jan 2020 10:20:16 +0000 |
| Subject: | Bug #79069 [Com]: Property name concatenation triggers deprecated warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224728@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79069&edit=1
ID: 79069
Comment by: bugreports at gmail dot com
Reported by: gwendal dot ledoussal at jymeo dot net
Summary: Property name concatenation triggers deprecated
warning
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: MacOS
PHP Version: 7.4.1
Block user comment: N
Private report: N
New Comment:
$this->{"foo_{$bar}"} = true;
Previous Comments:
------------------------------------------------------------------------
[2020-01-06 10:13:05] gwendal dot ledoussal at jymeo dot net
Description:
------------
PHP 7.4 deprecated array and string offset access with curly braces but it also affect property name
concatenation.
Test script:
---------------
<?php
class Foo {
public function __construct() {
$bar = "bar";
$this->{'foo_' . $bar} = true; // Works
$this->foo_{$bar} = true; // Triggers Array and string offset access syntax with curly braces
is deprecated
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79069&edit=1