Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71000 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11814 invoked from network); 4 Jan 2014 11:24:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2014 11:24:56 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.53 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.53 mail-oa0-f53.google.com Received: from [209.85.219.53] ([209.85.219.53:45366] helo=mail-oa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/00-11414-68FE7C25 for ; Sat, 04 Jan 2014 06:24:54 -0500 Received: by mail-oa0-f53.google.com with SMTP id m1so17091744oag.40 for ; Sat, 04 Jan 2014 03:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LbODG2guMAn4RQnjqpcl2mbw0JZVK1vSZ78Av924fUI=; b=D1/iCAyPWyAg5ofOz4zo9SsSNYCMFnuNXqdHuczveHOv3aFyl/u6ip0WED81wwlbV0 mb2vN+4YcMGmyje4yO+wyQV9CGc75Gxsp+07ahFJ3UIbulWePfR0Du1t61F9CDbDDwQJ sBhvecSHA2zIwjSe1uRRkmlJZO2/U7STtfXINDv/rrzKFL48SiiFAdscK729IRzVP2IY EX4raqVXDfuP1twm+C3diFyO1RjFOP6iXUWguSsGnCODkHWsohqT6KMmeVvssTnRo7mc 51oW6VF49L+ubaqUC0Ao5+OCRm5VdY/OBkqh6sOZZBzd8h+4wRhlXvWswMwLtqz10mIH CD6Q== MIME-Version: 1.0 X-Received: by 10.182.158.71 with SMTP id ws7mr63930761obb.6.1388834691152; Sat, 04 Jan 2014 03:24:51 -0800 (PST) Received: by 10.182.54.112 with HTTP; Sat, 4 Jan 2014 03:24:51 -0800 (PST) In-Reply-To: <52C7E318.5070808@fedoraproject.org> References: <52C7E318.5070808@fedoraproject.org> Date: Sat, 4 Jan 2014 12:24:51 +0100 Message-ID: To: Remi Collet Cc: PHP internals Content-Type: multipart/alternative; boundary=089e01494a166b287c04ef234689 Subject: Re: [PHP-DEV] Please feedback for Zend bug #66331 ZEND_SEND_PREFER_REF issue trying to overlad From: nikita.ppv@gmail.com (Nikita Popov) --089e01494a166b287c04ef234689 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Jan 4, 2014 at 11:31 AM, Remi Collet wrote: > See https://bugs.php.net/bug.php?id=66331 > With PHPUnit real use cse (trying to mock memcached class) > > We have more options in Extension land that in user land. > > Of course if will be great to be able to correctly handle those arginfo > mapping in userland, but we have, for now, no way to say "PREFER_REF" in > PHP land. > > So my proposal is to make proto check a little less stric and consider > ZEND_SEND_PREFER_REF as ZEND_SEND_REF, so this will allow to override a > internal class method (using "prefer") in a php class. > > > Any better idea ? > Or could I apply this fix ? > Changing a prefer-ref argument into a by-ref argument via inheritance violates LSP, so the code is right to refuse it. What I'd do instead is to automatically convert userland by-ref arguments extending prefer-ref arguments to also be prefer-ref. The resulting behavior might be a tad unexpected, but I think that's better than allowing LSP violations here. Nikita --089e01494a166b287c04ef234689--