Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21882 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87739 invoked by uid 1010); 16 Feb 2006 12:57:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87724 invoked from network); 16 Feb 2006 12:57:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2006 12:57:54 -0000 X-Host-Fingerprint: 195.190.153.92 mg002.armadahosting.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from ([195.190.153.92:57007] helo=mg002.armadahosting.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 5B/C2-03062-2D674F34 for ; Thu, 16 Feb 2006 07:57:54 -0500 Received: from fangel.idg.dk (unknown [62.199.138.131]) by mg002.armadahosting.com (Postfix) with ESMTP id B6F7579E7A; Thu, 16 Feb 2006 13:53:23 +0100 (CET) Received: by fangel.idg.dk (Postfix, from userid 1000) id 12AD355CC2; Thu, 16 Feb 2006 13:57:50 +0100 (CET) Reply-To: fangel@nable.dk To: Jochem Maas Date: Thu, 16 Feb 2006 13:57:49 +0100 User-Agent: KMail/1.8 Cc: Antony Dovgal , php internals References: <200602161232.48780.fangel@nable.dk> <200602161255.37040.fangel@nable.dk> <43F473DF.1080509@iamjochem.com> In-Reply-To: <43F473DF.1080509@iamjochem.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200602161357.49578.fangel@nable.dk> Subject: Re: [PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members From: fangel@nable.dk (Morten Fangel) On Thursday 16 February 2006 13:45, Jochem Maas wrote: > if that is the logic being applied in the engine then one might to wonder > why a function such as array_merge() was changed to emit a warning when any > of it's arguments are not arrays (whereas sometime in the past it used to > swallow [and I assume 'autocast'] whatever it was given without a hiccup). > > I have been told that such warnings as array_merge() now emits are for my > own good (in not so many words I was told it was "to protect me from my > stupid self"), if it's good for me when I use array_merge() why not when an > object is created implicitly (as in the example above)? actually my > preference would be to drop the warning in array_merge() in this case (it > seems like a more php way of doing things, imo) > > This was my initial thought when I saw the behaviour: "wow - this just wants you to do some _lousy_ programmering" and therefor thought that it needed a E_NOTICE.. (which I still do, but now I understand why it currently don't do so) If some functions throws notices when they have to "autocast", why doesn't php always do this (throws notices)? Or maybe it should just throw E_STRICT and let the perfectionists remove those issues if they want to do so... > > I'm very interested to learn what people think about this kind of thing in > general - and obviously if someone knows of material that explains the > reasoning behind the percieved inconsistency/problem I'd be very grateful. > > tar, > jochem Regards Morten