Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56498 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95168 invoked from network); 23 Nov 2011 10:51:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 10:51:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 213.123.20.128 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 213.123.20.128 c2bthomr10.btconnect.com Received: from [213.123.20.128] ([213.123.20.128:2947] helo=mail.btconnect.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/E0-24303-320DCCE4 for ; Wed, 23 Nov 2011 05:51:16 -0500 Received: from host81-138-11-136.in-addr.btopenworld.com (EHLO _10.0.0.4_) ([81.138.11.136]) by c2bthomr10.btconnect.com with ESMTP id FIE35986; Wed, 23 Nov 2011 10:51:13 +0000 (GMT) Message-ID: <4ECCD020.40602@lsces.co.uk> Date: Wed, 23 Nov 2011 10:51:12 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Firefox/7.0.1 SeaMonkey/2.4.1 MIME-Version: 1.0 To: PHP internals References: <20111123015008.GA12933@panix.com> <20111123023108.GA172@panix.com> <4ECCB549.904@lsces.co.uk> <4ECCC227.9000803@lsces.co.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4ECCD020.00F1, actions=tag X-Junkmail-Premium-Raw: score=7/50, refid=2.7.2:2011.11.23.92714:17:7.586, ip=81.138.11.136, rules=__MOZILLA_MSGID, __HAS_MSGID, __SANE_MSGID, __USER_AGENT, __MIME_VERSION, __TO_MALFORMED_2, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __CT, __CT_TEXT_PLAIN, __CTE, __ANY_URI, __CP_URI_IN_BODY, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_7000_LESS X-Junkmail-Status: score=10/50, host=c2bthomr10.btconnect.com X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0208.4ECCD021.0119:SCFSTAT14830815,ss=1,re=-4.000,fgs=0, ip=0.0.0.0, so=2011-07-25 19:15:43, dmn=2011-05-27 18:58:46, mode=multiengine X-Junkmail-IWF: false Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: lester@lsces.co.uk (Lester Caine) Ferenc Kovacs wrote: > > > On Wed, Nov 23, 2011 at 10:51 AM, Lester Caine > wrote: > > Ferenc Kovacs wrote: > > some clarification: > in the test script, Daniel declared $arr as: > $arr = array('exists' => 'foo'); > so when he tests > $arr['exists']['non_existent'] > PHP will see that $arr['exists'] is a string, and it will convert the > 'non_existent' index to int(0) and that will return the same > as $arr['exists'][0]: 'f' > If he would have defined $arr['exists'] as an array, then the code would > work as > he expected, empty would returned true for $arr['exists']['non_existent'] > > > The bit I am missing here is the statement that $arr = array ... has NOT > created an array with an element ['exists'] > > yes it did, but ['exists'] wasn't defined as an array, but as a string. THAT was what was confusing things ... but I wonder what code was failing in PEAR? The code here was looking for an array element to check that the ARRAY had been populated, but the holding element was just a simple string rather than an empty array. > ... I suspect that this is perhaps where the code *I* am looking at is > breaking down ... how SHOULD you define the array so that it is an array? So > that $family = array ( 'fam1' => 'JONES' ); is the base for the JONES family > rather than simply a string. All of this USED to be simple, but it seems to > be getting so cryptic that this is what is causing the trouble :( The legacy code methods may be wrong, but a lot of this code originates in PHP4 days, so when things do break what is needed is a clean upgrade guide which may help to isolate the bugs when they appear? > I think you just need a coffee. No just a version of PHP where I'm not firefighting changes but getting back to actually producing new code :( I can either test 5.4 or work ... I don't have time for both ... -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php