Bug #71614 [NEW]: echo "${str{1}}"; raises syntax error

From: Date: Wed, 17 Feb 2016 04:34:35 +0000
Subject: Bug #71614 [NEW]: echo "${str{1}}"; raises syntax error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199286@lists.php.net to get a copy of this message
From:             yohgaki
Operating system: irrelevant
PHP version:      Irrelevant
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:echo "${str{1}}"; raises syntax error

Description:
------------
Both ${var} and {$var} are supposed to work, but ${$var} raises syntax
error.

Test script:
---------------
php > $str = 'abc';

php > echo "${str{1}}";
PHP Parse error:  syntax error, unexpected '{' in php shell code on line
1

php > echo "{$str{1}}";
b


-- 
Edit bug report at https://bugs.php.net/bug.php?id=71614&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71614&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71614&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71614&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71614&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71614&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71614&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71614&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71614&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71614&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71614&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71614&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71614&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71614&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71614&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71614&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71614&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71614&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71614&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71614&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71614&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#199286) next »