Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51972 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56060 invoked from network); 21 Apr 2011 14:49:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Apr 2011 14:49:24 -0000 Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:64170] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/73-18586-BE340BD4 for ; Thu, 21 Apr 2011 10:49:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id B1BA55D12; Thu, 21 Apr 2011 10:49:13 -0400 (EDT) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cc8KJ3l9Hp1n; Thu, 21 Apr 2011 10:49:12 -0400 (EDT) Received: from djbondc (modemcable005.23-57-74.mc.videotron.ca [74.57.23.5]) by mail.ca.gdesolutions.com (Postfix) with ESMTPSA id AA8C65CFD; Thu, 21 Apr 2011 10:49:12 -0400 (EDT) To: , References: <4DAF4500.7070207@lorenso.com> In-Reply-To: <4DAF4500.7070207@lorenso.com> Date: Thu, 21 Apr 2011 10:49:12 -0400 Message-ID: <00dd01cc0033$47664ac0$d632e040$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acv/m3K67bv90FFCQi+kpDixs+XaagAjJZ/g Content-Language: en-ca Subject: RE: [PHP-DEV] Function proposal: varset From: jbondc@openmv.com ("Jonathan Bond-Caron") On Wed Apr 20 04:41 PM, D. Dante Lorenso wrote: >=20 > My proposal was called "filled" since it was the opposite of "empty" > which already existed. I extended the function to return the first=20 > non-empty value or null if all values evaluated as empty. >=20 > You could use the function like this: >=20 > $x =3D filled($_GET['x'], $obj->something, $default, 'default'); >=20 > Like I said, though, I don't think this can be done in the language=20 > because I think they ran out of OPCODES and would have to tear apart=20 > the whole PHP engine to support such a feature. >=20 That's not the reason, there's 127 / 256 opcodes. So far "filled", "varset", "coallesce", "ifsetor" or any operator would = likely have to manipulate opcodes. http://php.net/~helly/ze2-ifsetor-20040901.diff.txt From what I understand, zeev and andi are strongly opposed to adding a = new opcode. I'm sure they have their reasons. Maybe there's another approach where ~ E_NONE could be passed to = zend_error ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ { if(type & E_NONE) return; } Then modify to zend_vm_gen.php to pass E_NONE if within 'ifsetor'. Either way, there's a solution for it, I think the debate is over how = it's implemented. -- Worth reading https://wiki.php.net/rfc/ifsetor#rejected_features -- Why? I think it simply boils down to this: - PHP *developers* want a function for it. Derick =20