Re: PHP5 bloats the code

From: Date: Sat, 24 Apr 2004 10:54:19 +0000
Subject: Re: PHP5 bloats the code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-184500@lists.php.net to get a copy of this message
"Johannes Reichardt" <mailbox@gramba.net> wrote in message news:408A438F.4090708@gramba.net... > Hi there, > > i don´t know if this is the right place to ask but since there are a lot > of cracks around i thought i throw this in here. actually i am using > typo3 (www.typo3.org) a full-blown, extendable cm-framework that is > based on php. so here is the problem: > > typo3 very often uses a syntax like this: > > is_array($TCA['pages']['columns']['title']) > > but this will spawn an error in PHP5 that says, "$TCA['pages']" is not an array. > > The solution would be > if ( > is_array($TCA['pages']) && > is_array($TCA['pages']['columns']) && > is_array($TCA['pages']['columns']['title']) ) > > > actually that is really ugly code and would be hardly acceptable. > > i dunno who to ask, but if that is a verified issue and this behaviour > goes in the final php5 we had a lot of trouble - so who can i ask to > make it work "the old fashioned" way as well? > > - Johannes Hi Johannes, look into the mailing list archive (or newsgroup) at this thread from yesterday, 11:55, started by Christian Jul Jensen: "How to do type/existence checking in PHP5". It's about exactly the problem you have. There are several answers. Take a look. Regards, Torsten

« previous php.general (#184500) next »