Bug #67781 [Com]: Use array() instead of square brackets

From: Date: Tue, 05 Aug 2014 17:10:39 +0000
Subject: Bug #67781 [Com]: Use array() instead of square brackets
References: 1  Groups: php.standards 
Request: Send a blank email to standards-+get-336@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67781&edit=1 ID: 67781 Comment by: joelm@php.net Reported by: joelm@php.net Summary: Use array() instead of square brackets Status: Open Type: Bug Package: PHP Language Specification PHP Version: Irrelevant Block user comment: N Private report: N New Comment: There was disagreement here: "Both notations are permitted, and unless we’re going to deprecate one of them, we should be able to use both. If that causes a significant problem, then IMHO the wrong spelling was chosen for the new/alternate notation." Previous Comments: ------------------------------------------------------------------------ [2014-08-05 17:09:56] joelm@php.net Description: ------------ https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#array-creation-operator It might be better to say that "array(..)" is the 'array creation operator' and mostly use "array(..)" instead of "[..]" in examples. Most existing PHP code uses "array(..)" way more than "[..]" (because "[..]" was added very recently), and I think using "array(..)" as the 'array creation operator' helps disambiguate it from the subscript operator ("[]"). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67781&edit=1

« previous php.standards (#336) next »