# PHP 5.3: Is the use of {} to access string offsets deprecated?

- Thread: https://externals.io/message/44722
- Original archive: https://news-web.php.net/php.internals/44722
- Started by Christian Schneider on 2009-07-06T16:00:56+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

---

## #44722 — Christian Schneider — 2009-07-06T16:00:56+00:00

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

The migration guide states that "The use of {} to access string offsets
is deprecated.  Use [] instead." but the code in zend_compile.c is
commented out with #ifdef ilia_0.

What's the take on this? Will it be deprecated later or should that part
be removed from the migration document?

Another side-note: The paragraph "The behaviour of functions with
by-reference parameters called by value has changed. Where previously
the function would accept the by-value argument, a warning is now
emitted and all by-ref parameters are set to NULL" was confusing for a
couple of people here and to be honest I'm not sure either what it means ;-)

Regards,
- Chris

---

## #44724 — Philip Olson — 2009-07-06T16:18:27+00:00

URL: https://externals.io/message/44722#44724 · In reply to: #44722

> The migration guide states that "The use of {} to access string  
> offsets
> is deprecated.  Use [] instead." but the code in zend_compile.c is
> commented out with #ifdef ilia_0.
>
> What's the take on this? Will it be deprecated later or should that  
> part
> be removed from the migration document?


It's been awhile but I once researched this, spoke with humans, and  
determined this syntax is deprecated as of PHP 6 and documented[1] it  
as such. However, that was almost three years ago so maybe the times  
have changed.

Regards,
Philip

[1] http://php.net/manual/en/language.types.string.php#language.types.string.substr
