From bf9085b2b13e3ce366c5388c5b4ecdd42eb833e5 Mon Sep 17 00:00:00 2001 From: Sherif Ramadan Date: Wed, 14 Nov 2012 17:08:15 +0000 Subject: [PATCH] Added note for accessing array elements with curly braces - fixes bug #55324 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328358 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/types/array.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/language/types/array.xml b/language/types/array.xml index 323a2ec491..04dcb9b90f 100644 --- a/language/types/array.xml +++ b/language/types/array.xml @@ -303,6 +303,12 @@ string(3) "foo" + + + Both square brackets and curly braces can be used interchangeably for accessing array elements (e.g. $array[42] and $array{42} will both do the same thing in the example above). + + + As of PHP 5.4 it is possible to array dereference the result of a function or method call directly. Before it was only possible using a temporary variable.