# dropping curly braces

- Thread: https://externals.io/message/20109
- Original archive: https://news-web.php.net/php.internals/20109
- Started by jevon@jevon.org on 2005-11-17T23:19:51+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #20109 — jevon@jevon.org — 2005-11-17T23:19:51+00:00

URL: https://externals.io/message/20109#20109

Is there anything wrong with having a convention for character access of strings? Most PHP programmers see {} as string access and [] as array access - sure, they might be functionally identical, but its the convention which is important.

Jevon


>  -------Original Message-------
>  From: Rasmus Lerdorf <rasmus@lerdorf.com>
>  Subject: Re: [PHP-DEV] dropping curly braces
>  Sent: 17 Nov '05 12:11
>  
>  Andreas Korthaus wrote:
> > […]
>  
>  Your argument falls apart there.  Try it:
>  
>  $a = array("ab","cd","ef");
>  echo $a{2};
>  
>  Guess what that prints?  {} has nothing to do with strings.  They are
>  100% equivalent to [] and as such add nothing to clarity.
>  
>  -Rasmus

---

## #20123 — Andrei Zmievski — 2005-11-18T01:37:16+00:00

URL: https://externals.io/message/20109#20123 · In reply to: #20109

How do you know this? Have you conducted polls?

-Andrei




> Is there anything wrong with having a convention for character  
> access of strings? Most PHP programmers see {} as string access and  
> [] as array access - sure, they might be functionally identical,  
> but its the convention which is important.
