Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79437 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1296 invoked from network); 5 Dec 2014 01:07:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2014 01:07:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.169 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.223.169 mail-ie0-f169.google.com Received: from [209.85.223.169] ([209.85.223.169:46346] helo=mail-ie0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/15-61462-26501845 for ; Thu, 04 Dec 2014 20:07:47 -0500 Received: by mail-ie0-f169.google.com with SMTP id y20so17249608ier.28 for ; Thu, 04 Dec 2014 17:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=0YV9b3wJ9qCDl/pXYByL/Mg+Ruoizx/2UtrojnxdecA=; b=fqqd9uNO3OuZIwybeVbSpVk1jqDl+RzoQrzNTxU3cJsa5fUPGoANUOb04FDAcS7vLg 5YY6OlmZjcaLblIwa3He6JY/KmjkzA0NsVywRiisVIGkLAyFdcmmGTIKXk5fU16eFt7Z h499JSI76fPABrALoyCp01iqwXOFrNgQRGo8vhsz50aObesk1pgJT0wk5+Qr5YtkhZFc VkLqFbhIRuqqLkZqeQlNSHPW3STl8sHcMMXgD2J6ZFtmwhv52/11AeU+0ZZbBa7AkoWm MMJIG5rQDsH42xJMA4ihxviDM507yXvO6Lw96eY2tb4xkuNtd/uzI4ONAQu/TFJJhRan ceug== X-Received: by 10.107.36.5 with SMTP id k5mr12626725iok.4.1417741664050; Thu, 04 Dec 2014 17:07:44 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.107.164.217 with HTTP; Thu, 4 Dec 2014 17:07:03 -0800 (PST) In-Reply-To: References: Date: Fri, 5 Dec 2014 10:07:03 +0900 X-Google-Sender-Auth: nyTutvhhieLiC3p891QvETF0f1g Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1140f54e44e67f05096db404 Subject: Re: Only variables can be passed by reference From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1140f54e44e67f05096db404 Content-Type: text/plain; charset=UTF-8 Hi all, On Thu, Dec 4, 2014 at 5:28 PM, Yasuo Ohgaki wrote: > I think we can get rid of this error now when literal is returned. > The reason we have E_STRICT error is that legacy PHP didn't > support this, I suppose. > > http://3v4l.org/8fISj > > Is it possible to allow literal as referenced parameter for PHP7? > It's better to remove needless restrictions where it is possible. > HHVM seems already support this. > > http://3v4l.org/t79rF > > Any comments? > It may be better to focus on return value from functions/methods. There are cases that return values are better to be treated as usual variables. For example, http://3v4l.org/2prWX E_STRICT error here is too much. IMHO. I think this kind of code should be allowed without errors rather than forcing users to save return value to variable. e.g. $v = f2(); f1($v); Making scalar to array may be stay as it is now. http://3v4l.org/Ob1o2 HHVM behavior is interesting. It treats return value as usual variable, but HHVM does not allow casts. http://3v4l.org/J4Q8e Any comments? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1140f54e44e67f05096db404--