Reply to Re: function call as an array

Your name:

Reply:


Posted by Toby A Inkster on 04/25/07 09:11

Skeleton Man wrote:

> print @{[someFunctionCall()]}[0];

PS -- this sort of thing is generally unsafe, as you've not checked that
the returned array even *has* an element with index 0. someFunctionCall
might be defined as:

function someFunctionCall ()
{
if (some error condition)
return FALSE;
else
return array(etc, etc, etc);
}

You should really check that someFunctionCall has returned an array, and
that the array has an element 0 before you try to print element 0 out!

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

[Back to original 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

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