You are here: Re: what is the meaning « PHP Programming Language « IT news, forums, messages
Re: what is the meaning

Posted by NC on 11/28/06 21:47

Thomas Mlynarczyk wrote:
>
> > sam wrote:
> > > What is the meaning of this operator:-
> > > =>
> >
> > Assignment - used in arrays?
>
> Hm. But why the need for a special operator here? Wouldn't
> a simple = have done the job just as well?

Yes, but you'd have to write it differently.

Consider this simple example:

$someArray = array('field1' => 1, 'field2' => 'two');

If it equivalent to:

$someArray = array();
$someArray['field1'] = 1;
$someArray['field2'] = 'two';

Moreover, the second option might trigger an E_NOTICE, since
you would be trying to assign a value to a not-yet-defined member
of the array...

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация