Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83970 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93534 invoked from network); 27 Feb 2015 08:01:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2015 08:01:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.41 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.41 mail-la0-f41.google.com Received: from [209.85.215.41] ([209.85.215.41:40248] helo=mail-la0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/34-32582-96420F45 for ; Fri, 27 Feb 2015 03:01:46 -0500 Received: by labgd6 with SMTP id gd6so15940649lab.7 for ; Fri, 27 Feb 2015 00:01:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=0eH+gQD/v5iS/WWbtv9kUmvEKEXSyppdVnd+mk5uHyU=; b=CMpaI1UCNVsM4DeTFr8rtKWYa4IsdWr9EHxQk9GeUYXPppaQb00C3bxDLWFVI2kjsQ ilue0zwwSo+9rPDF4crJg9/tK2oN51TP3nABPeCK3isSfVM76CnnjnY4HLMMpXvN6cHi z2adalXDPpI7lpM8jcwoMYcFQ1Vop+0CqmKmT6hzTDRy21W9bPsXYTC7NZ66E1IOQ6AX 9udCz0f9QEFYWuKmNONlZst0p2ONmySJprlx5RWizEE8R1awd4dciJ8SHkiAqlHjn2jl vOB8ky6GC4JTDrV8YlPvKnmTK0Fgd/lBD1Ft6Yj6BDgTgCUIZsHabnRvhmVJOH4CBSyP wnKg== X-Gm-Message-State: ALoCoQmSyAWRu6/vQFKw4/jSL1nTXG3HdisYoZOf6sttWz7waMHEFF6focSaNXjTY7nkeOmXQwE+KUtLTMP9wOHqwiqgrf1bW7bvRIwbVhMS9B2J/1Gof0Bi1WfYJTcX46uTOU4pKtNehXInzSgwx07u8BQxBYnjuw== X-Received: by 10.152.245.38 with SMTP id xl6mr11323461lac.68.1425024102945; Fri, 27 Feb 2015 00:01:42 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPSA id ac6sm669079lbc.42.2015.02.27.00.01.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 00:01:42 -0800 (PST) Received: by labhv19 with SMTP id hv19so15833940lab.10 for ; Fri, 27 Feb 2015 00:01:41 -0800 (PST) X-Received: by 10.152.36.138 with SMTP id q10mr11073257laj.113.1425024101198; Fri, 27 Feb 2015 00:01:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.28.198 with HTTP; Fri, 27 Feb 2015 00:01:20 -0800 (PST) In-Reply-To: References: <0acc01d05231$f2274780$d675d680$@php.net> Date: Fri, 27 Feb 2015 16:01:20 +0800 Message-ID: To: francois@php.net Cc: "Matthew Weier O'Phinney" , PHP Internals , Zeev Suraski Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Follow-up to STH user experience, this time with actual testing From: laruence@php.net (Xinchen Hui) Hey: On Fri, Feb 27, 2015 at 3:59 PM, Xinchen Hui wrote: > Hey: > > On Fri, Feb 27, 2015 at 10:06 AM, Fran=C3=A7ois Laupretre wrote: >>> De : Matthew Weier O'Phinney [mailto:matthew@zend.com] >>> >>> - PHPUnit passes a boolean false to `debug_backtrace()`... which is >>> documented >>> as expecting an integer! (There are actually several constant values = it >>> accepts, all of which are integer values.) In this case, PHPUnit is r= elying >>> on the fact that the engine casts booleans to the integers 0 and 1. (= Zeev has >>> written to the list already indicating that this coercion path will b= e >>> supported in the patch.) >> >> AFAIK, we won't support boolean to integer. IMO, considering Boolean as = integer is a bug and must not be supported. > in a internal developer's view: > > bool false =3D=3D=3D 0, bool true =3D=3D 1; > > maybe this case should be supported? > > considering such usage : > > if (substr($str, strrpos($str, ':delimiter:')) { > > } > > this is not a really world usage, I just made it up, this codes is try > to find a last part of a string which is contacted with a dimileter > ":delimiter": sorry, the example is wrong, but I think you may get my idea. a works example is: find the first part: substr($str, 0, strpos($str, ":delimiter:")) which is common used,, right? thanks > > like a:delimiter:b, c:dilimiter:d > > it works well before, because, if there is no match, it returns false > before.. (which we will think it's '0') > > then the whole $str is returned.. > > but if we don't support bool false -> 0? > > thanks >> >>> - PHPUnit is passing the results of $reflector->getDocComment() blindly= to >>> substr() and preg_match*(). getDocComment() is documented as returnin= g >>> EITHER >>> a string OR boolean false. Again, PHPUnit is relying on PHP to cast b= oolean >>> false to an empty string. (Zeev has also indicated this coercion path= may be >>> re-introduced.) >> >> The same as above for bool -> string. >> >> I hope you're wrong because I wouldn't like supporting boolean to scalar= back again. >> >> Your test demonstrates this because you found undetected bugs. I am more= and more sure that, what I first said as a joke, will prove true : during = the next years, STH will be used mostly as a debugging tool, proving opposi= te arguments were FUD or, at least, phantasm. >> >> Regards >> >> Fran=C3=A7ois >> >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > Xinchen Hui > @Laruence > http://www.laruence.com/ --=20 Xinchen Hui @Laruence http://www.laruence.com/