Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91846 invoked from network); 27 Feb 2015 07:59:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2015 07:59:55 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:40895] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/E3-32582-8F320F45 for ; Fri, 27 Feb 2015 02:59:53 -0500 Received: by labgd6 with SMTP id gd6so15931796lab.7 for ; Thu, 26 Feb 2015 23:59:48 -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=1CZUd0m7byPIig9OE0ibdsEYXvBZNpQvjUeC3N81i88=; b=ZRqW7+Wrac3p9OFucQcSJcuRbmGn89C4suG/1+x6RAakaA/7z0eVCTC6hDmETFKytw v28/o0ECZyJejYWwUbmpS+kDmMQXARtq0S/sTGr3ce+aTq/UP7MiZuku8imri+oMdP9G 8qiD1SeubxjjUxPP8QRcFx+Uxr5elnGR9QAYfXEVfXLxzw6DWtzOEvChd1CG72wBXBPF x/nGQKjyoGsEsp5qTIeZZp3fNlBC4E4OBzAGH6IuPeLjT22/OXBEh/DnTnhAApxgDso+ 7Es2PKb94RGqtqHX9M8H6wV8htH2uHgpJ7g+p++iwx0c6hPoknAzS2HOCqk3dUK8lvK6 JRoQ== X-Gm-Message-State: ALoCoQlBWzde6T0QfsZxA97zTLr1H4rSyMIuOv0KC20zp0cOc32rxTIkV31k5v7+0J4zhsoJAxrsAmD9SEKkCqBhv15TNoo9yw6BH3UDPgWI3OC7Ie9eYYQFUTcKRp6yvfD07UuBJEEpPAoM1pU5p1q4mftdFu3GJw== X-Received: by 10.112.98.201 with SMTP id ek9mr11324708lbb.68.1425023988520; Thu, 26 Feb 2015 23:59:48 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPSA id ej11sm674368lad.22.2015.02.26.23.59.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 23:59:47 -0800 (PST) Received: by lbiw7 with SMTP id w7so15672356lbi.9 for ; Thu, 26 Feb 2015 23:59:31 -0800 (PST) X-Received: by 10.112.90.193 with SMTP id by1mr11064995lbb.113.1425023971434; Thu, 26 Feb 2015 23:59:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.28.198 with HTTP; Thu, 26 Feb 2015 23:59:09 -0800 (PST) In-Reply-To: <0acc01d05231$f2274780$d675d680$@php.net> References: <0acc01d05231$f2274780$d675d680$@php.net> Date: Fri, 27 Feb 2015 15:59:09 +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 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 i= t >> accepts, all of which are integer values.) In this case, PHPUnit is re= lying >> on the fact that the engine casts booleans to the integers 0 and 1. (Z= eev has >> written to the list already indicating that this coercion path will be >> supported in the patch.) > > AFAIK, we won't support boolean to integer. IMO, considering Boolean as i= nteger 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": 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 returning >> EITHER >> a string OR boolean false. Again, PHPUnit is relying on PHP to cast bo= olean >> 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 t= he next years, STH will be used mostly as a debugging tool, proving opposit= e 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 --=20 Xinchen Hui @Laruence http://www.laruence.com/