Bug #72123 [NEW]: Variable variable assignment from array breaks
| From: | haveacigaro at gmail dot com | Date: | Thu, 28 Apr 2016 15:38:41 +0000 |
| Subject: | Bug #72123 [NEW]: Variable variable assignment from array breaks | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-200810@lists.php.net to get a copy of this message | ||
From: haveacigaro at gmail dot com
Operating system: osx
PHP version: 7.0.5
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Variable variable assignment from array breaks
Description:
------------
When creating a variable variable from an array, php identifies the
string as an array in php 7, but not in previous versions.
Test script:
---------------
<?php
$content = [
'layout' => 'heading'
];
$heading = function () {
return "Hi";
};
$layout = "heading";
echo $$layout(); // Works
echo $$content['layout'](); // Doesnt work
--
Edit bug report at https://bugs.php.net/bug.php?id=72123&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72123&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72123&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72123&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72123&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72123&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72123&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72123&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72123&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72123&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72123&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72123&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72123&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72123&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72123&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72123&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72123&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72123&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72123&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72123&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72123&r=mysqlcfg