Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98432 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34053 invoked from network); 8 Mar 2017 15:52:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2017 15:52:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.122 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.122 mx201.easyname.com Received: from [212.232.28.122] ([212.232.28.122:57913] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/F7-06022-9A820C85 for ; Wed, 08 Mar 2017 10:52:10 -0500 Received: from cable-81-173-135-7.netcologne.de ([81.173.135.7] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cldsi-0006By-7K; Wed, 08 Mar 2017 15:52:09 +0000 Reply-To: internals@lists.php.net References: To: Andrey Andreev , Ryan Pallas Cc: "internals@lists.php.net" Message-ID: <996dc359-cbc1-1c76-dacc-f748d0941aa6@fleshgrinder.com> Date: Wed, 8 Mar 2017 16:51:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString() From: php@fleshgrinder.com (Fleshgrinder) Hey! :) The reference is actually not a problem for a Stringable because you would get the "Only variables can be passed by reference" error with an object if `strict_types` is enabled. Simply because the object **MUST** be converted into a string. The object itself does not satisfy the constraint, but the object clearly states that it can be converted into a string at any point. Not doing so would violate what `strict_types` actually promise us. ;) -- Richard "Fleshgrinder" Fussenegger