Re: Manual contradiction concerning string access?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2007-02-20 at 17:21 +0100, Németh Zoltán wrote:
> AFAIK the english manual is more up to date, so I would follow that
> 
> greets
> Zoltán Németh
> 
> 2007. 02. 20, kedd keltezéssel 17.15-kor Christian Heinrich ezt írta:
> > Dear list,
> > 
> > today, I read in a german PHP forum about a problem with accessing an 
> > offset of a string.
> > 
> > For example, if you have a variable like
> > 
> > $string = "this is my string";
> > 
> > and you want to access the third character at once, I would suggest to use
> > 
> > $string{2}

Use [], internals recently (7 months or so ago) reversed their opinion
of on deprecating [] for strings in favour of {}. The {} almost got
deprecated itself, but was saved in lieu of user feedback on internals.
So it would seem [] is the superior choice and {} may someday get cut.
This is in spite of the PHP group original recommending {}.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux