Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65839 invoked from network); 8 Mar 2017 22:42:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2017 22:42:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.180 mail-wr0-f180.google.com Received: from [209.85.128.180] ([209.85.128.180:35847] helo=mail-wr0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/CC-06022-1C880C85 for ; Wed, 08 Mar 2017 17:42:10 -0500 Received: by mail-wr0-f180.google.com with SMTP id u108so33338849wrb.3 for ; Wed, 08 Mar 2017 14:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=mMQUvQtpQqcsigExU2IBnoVzFp3JGzNXUvDfGWguWR8=; b=KEt4lodQWw8p7863YLoGRwD+v7Vsk2uC9r6tTmFKV6Doz16Yv7lb6rDlCFxK8ej7S4 X36pwLwjugYZuI6bGVIB2VZFLlJnZDG6Of1cBU+sMHG1LwdKUljzqewMttTqnP387bcG T7AsGGxptTP432Xdgoe3E01361DOGEriFj0C4ehf7S0spfBWCAYYbWq5y50DcWr2N/Wk bzULeBpBEf2xmOymBi8MV+E7Zur8UVVnKSqvgKmdWLHVU8VLrXLGUdRw62LDwQkihhTF p0Cy4zeR5NyX221T6T620ACfpF12kVFMarK/0d7HK9z161E74nhVdMQRGZ7F88kjbb/V 33Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=mMQUvQtpQqcsigExU2IBnoVzFp3JGzNXUvDfGWguWR8=; b=cTjCDHVJ4F9DFHyJSSWhB4ty4d/mlGA0uVmNxS8C72Ze1Aybeq34tuatJawLWEPVs+ 3NkOGVoiGObSxW2+2RM0v6E+wiBOx6/v5VHFu1gdHtnTrWL7CQ5jL67EXHKxFQqNkctB IuAAgo7UWp5tIGak8wCHkAMfTvkMUDUicYa8rF0PAWe6xboKYPrW5douz16XPUfbsJ6V /0qUuP+ND1o1J4baBXK8szfASJ8S8TdHQseodyO9oPIJC6TcA0d6t/ovSXzZNHPW266E Mv8smg5uShjjXX+WSjIEgF1FDMmjFch/KHJE+KEQYmpTfjvx4eI6hs5fEkN51e7ymqOV dXLw== X-Gm-Message-State: AMke39mTQ1Mv4QofUyvJwjK8fl/AM8AX0eEV246Qls4sgVTWPbZaXiamWh9HUQCshOC/fw== X-Received: by 10.223.130.81 with SMTP id 75mr8105827wrb.59.1489012926849; Wed, 08 Mar 2017 14:42:06 -0800 (PST) Received: from ?IPv6:2a00:23c4:4bd2:6e00:a4c4:59ab:eee3:d540? ([2a00:23c4:4bd2:6e00:a4c4:59ab:eee3:d540]) by smtp.googlemail.com with ESMTPSA id o52sm5876621wrb.51.2017.03.08.14.42.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 14:42:06 -0800 (PST) References: To: "internals@lists.php.net" Message-ID: <24efb0e7-b0e3-68ed-5f42-2d5481f8f291@gmail.com> Date: Wed, 8 Mar 2017 22:42:05 +0000 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; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString() From: rowan.collins@gmail.com (Rowan Collins) On 08/03/2017 22:24, Andrey Andreev wrote: > This is why I was concerned about the discussion becoming too broad - > it brings us (or me anyway) back to square 1, if not even out of > bounds. Sorry :( > I do agree that we can't have pseudo-types for everything, but can we > at least have meaningful ones? Sure, but you need to justify why your particular choice of pseudo-type is more meaningful than any of the other combinations. I still don't understand what you're using this check for that means you want to exclude integers. If you're passing on the value to anything that actually needs a string, you're doing a string cast, either explicitly or implicitly, so there's no difference between me passing you (string)'42', (int)42, or new class { function __toString() { return '42'; } } My best guess was that you wanted to do something *different* if it was an integer, but as I showed in my last example that doesn't actually need you to exclude them from the new function. Regards, -- Rowan Collins [IMSoP]