Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95508 invoked from network); 8 Feb 2015 03:52:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2015 03:52:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.192.43 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.43 mail-qg0-f43.google.com Received: from [209.85.192.43] ([209.85.192.43:39344] helo=mail-qg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/14-07765-48DD6D45 for ; Sat, 07 Feb 2015 22:52:36 -0500 Received: by mail-qg0-f43.google.com with SMTP id i50so6006256qgf.2 for ; Sat, 07 Feb 2015 19:52:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=y1gBjkdn+GvnqfNHYn+GcErFKiTiHI3voYCnXJfpe9Y=; b=NzXsbw/CZ97M8ZS7hm2EHuabQ/RlBuqHvq2tbtPGHvyn9VrdUgIfxUR0iVCfBSJrER WCQNJZARuA5xbw3Q5FDYHKQP7uN96+wBt0kXKKOTrjvl7ut+hM/+R2qqbGmyM1ZSnGN5 ecpFtdK9errU8qIuXpww6+EMhm7Oz9Smxi3AE5mIMB8Qp1R8tNDyItDRp1u4MTLpVHVu wCp8l2a1dx/I9ZZ/+cdq6LchiRgHfNXphk46CoV1BeFh1iBhMY94D0A9Gm+wRwKQA/na EI156W3XYXz+NNMFnwfn7ANnYXbw/t3Tpc27yYFZFf+JwMv0RHX0ipBpzf9yUsaRrWwr 6UTw== X-Gm-Message-State: ALoCoQkDVVezpGbCgNkiINOxFf/LCmlzT5rIwQoljNJErtotD+qK+mBz2HoDSnSWEUHnwW+wcyw3 X-Received: by 10.140.106.228 with SMTP id e91mr24906520qgf.19.1423367553208; Sat, 07 Feb 2015 19:52:33 -0800 (PST) Received: from [192.168.0.21] ([184.164.171.249]) by mx.google.com with ESMTPSA id w105sm7668636qgw.25.2015.02.07.19.52.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Feb 2015 19:52:32 -0800 (PST) Message-ID: <54D6DD7E.5060602@lerdorf.com> Date: Sat, 07 Feb 2015 22:52:30 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andrea Faulds CC: =?UTF-8?B?UGF2ZWwgS291xZlpbA==?= , PHP Internals References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <9E1C2427-0295-4F3E-BD29-04DA84321067@ajf.me> <54D6CC39.50708@lerdorf.com> <93AAEA55-1C03-46AD-88D0-6A2F5531FCA6@ajf.me> In-Reply-To: <93AAEA55-1C03-46AD-88D0-6A2F5531FCA6@ajf.me> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4pFa4mmB9VqrEbCa6mNT5Tfum3ounBOwQ" Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: rasmus@lerdorf.com (Rasmus Lerdorf) --4pFa4mmB9VqrEbCa6mNT5Tfum3ounBOwQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/07/2015 09:51 PM, Andrea Faulds wrote: >> tan(1); >> echo strstr("test", "est", 1); >=20 > Banning int->float and float->int is both a pain point and sometimes a = life-saver. It=E2=80=99s annoying that tan(1) doesn=E2=80=99t work. On th= e other hand, you discover if your ints floats would be silently truncate= d (as I did with PictoSwap). >=20 > I wouldn=E2=80=99t say that int->string not working is a problem, thoug= h. Seeing something like strstr(=E2=80=9Ctest=E2=80=9D, =E2=80=9Cest=E2=80= =9D, 1); is rather confusing. Looking at it, I=E2=80=99d think the third = parameter is some sort of number for you to want to pass an integer to it= =2E If I want a string, I=E2=80=99ll use one. This isn't int->string. This is int->boolean. The 3rd arg to strstr() is a boolean and passing 1 instead of true makes it blow up. It is very very common for people to pass 0 or 1 in place of true/false to all sorts of things in PHP. > Yes, the RFC is somewhat inaccurate in that respect. It is per-file in = one sense (like encoding, but unlike ticks, it has no effect on the inclu= ding or included files). However, it technically affects the remainder of= the file, not the whole file. Well, no, not the remainder of the file either since it can be switched again. It only affects the part of the file between declares if there is a second one. -Rasmus --4pFa4mmB9VqrEbCa6mNT5Tfum3ounBOwQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTW3X4ACgkQlxayKTuqOuAM5ACfWRtfIwwoZiw5IRRu8dJriwZT VNAAn0EXkItfuECNyFNeEmLpQXWYTJhX =9Cwr -----END PGP SIGNATURE----- --4pFa4mmB9VqrEbCa6mNT5Tfum3ounBOwQ--