Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98450 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80563 invoked from network); 9 Mar 2017 02:18:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2017 02:18:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.174 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.82.174 mail-ot0-f174.google.com Received: from [74.125.82.174] ([74.125.82.174:34637] helo=mail-ot0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/FE-06022-87BB0C85 for ; Wed, 08 Mar 2017 21:18:32 -0500 Received: by mail-ot0-f174.google.com with SMTP id o24so47615585otb.1 for ; Wed, 08 Mar 2017 18:18:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=FWaer+yLR3Xe+WaHaNLf7iy80uM5seQi4JT9FwF8IXk=; b=rFwxf4CZAjc/v11N+733xRj7o/5yEIfDGjCnfg2oCYapxNx3mcMCqPJ06yHfzHln7k tTkuPg4slY44KYWxro6KfrhON7A6unkBnb0rDdVgx4PZEaNn5ITOeLgQ6Se84jPtRoEQ o4ma7NxwnwTjwgKJLnz+8jfBa2Bs/z/RuTpIcntV96pHIREZWVYNuOL7G42+P5eDtosp OunOTvkeqYAdzVaOE/1wejZZ34pIRH3EsfUQKO9XJwI+OAu41ry3TZ+q/Lt70n/IdsJk dxKFFETLk8bwVorGlOpqL3V9jS3AJt393IiIKzjK8ZzXHktCaskCByPHFrGDKndijKiT UMQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=FWaer+yLR3Xe+WaHaNLf7iy80uM5seQi4JT9FwF8IXk=; b=tJJc30I43A7RI47Fqwg9CGJ/3tQUnrkPpm2uahWcovkJknt7uRN1lJ6W3pxlJBvNv3 qbQasa9ExyKETMFKvIg/Jf/UxHjOViFTLsQdEZSa41jipSKj/HN+mLlvbISSGPh/wzoF ZwvdedKhh4FVZVebwPaomgG63SQzKKhAKAz0WS+9T/8Xc4iJLlQFSVHzMxopJdBIDU5K rfLXpMiCtD5Nm9/gVWsmpurixOJiPvDQxCuoIYu3gJJJtrrNZ0qJsUUQB/hk4be3OtOu VY7U+KNdhPxzDMF6zrl2+ebGAU7a3UQfWp6ezE9WPtUyLntlPXPQQJ/ONqVJnC/tgIyj TYiA== X-Gm-Message-State: AFeK/H1TP8wSWdbJCxEwUncTC686XuexElVzXVJr8AEpw9YyKsirTuhZ8aoDSJ0GjyIwEQ== X-Received: by 10.157.50.198 with SMTP id u64mr4992865otb.143.1489025909747; Wed, 08 Mar 2017 18:18:29 -0800 (PST) Received: from ?IPv6:2602:306:ce9c:e680:b9e8:89c5:8ff4:f1a1? ([2602:306:ce9c:e680:b9e8:89c5:8ff4:f1a1]) by smtp.gmail.com with ESMTPSA id j128sm2328068oif.32.2017.03.08.18.18.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 18:18:28 -0800 (PST) To: Andrey Andreev , "internals@lists.php.net" References: Message-ID: Date: Wed, 8 Mar 2017 18:18:27 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString() From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I submitted a GitHub PR* to allow objects implementing __toString() to > *optionally* pass is_string() validation. More verbose wording of my > motivation can be seen in the PR description, but here are the main > points: I don't think it's right approach. is_* functions check the current type of the value, not whether it can be converted to another type. If we need ones that express the latter, we should have different functions. Also, as already noted, having __toString doesn't mean it returns something useful. -- Stas Malyshev smalyshev@gmail.com