Bug #68182 [NEW]: array("foo", "bar")() is invalid syntax

From: Date: Wed, 08 Oct 2014 07:47:11 +0000
Subject: Bug #68182 [NEW]: array("foo", "bar")() is invalid syntax
Groups: php.standards 
Request: Send a blank email to standards-+get-496@lists.php.net to get a copy of this message
From: chx Operating system: PHP version: Irrelevant Package: PHP Language Specification Bug Type: Bug Bug description:array("foo", "bar")() is invalid syntax Description: ------------ According to the specs, https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#function-call-operator any postfix expression + argument list is a valid function call. Looking at postfix expressions https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#general-3 it says array-creation-expression is a postfix expression. Test script: --------------- array("foo", "bar")(); Expected result: ---------------- PHP Fatal error: Class 'foo' not found in Command line code on line 1 Actual result: -------------- PHP Parse error: syntax error, unexpected '(' in Command line code on line 1 -- Edit bug report at https://bugs.php.net/bug.php?id=68182&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68182&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68182&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68182&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68182&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68182&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68182&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68182&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68182&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68182&r=support Expected behavior: https://bugs.php.net/fix.php?id=68182&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68182&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68182&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68182&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68182&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68182&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68182&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68182&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68182&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68182&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68182&r=mysqlcfg

« previous php.standards (#496) next »