Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-21 Thread Andrea Faulds
On 17 Aug 2014, at 20:58, Marc Bennewitz wrote: > > I've created a draft RFC and patch to change the behavior of non-strict > string to string comparison to be binary safe (as the strict comparison > operator does): > > https://wiki.php.net/rfc/binary_string_comparison > > On comparing

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Andrea Faulds
On 20 Aug 2014, at 19:36, Marc Bennewitz wrote: > > On 20.08.2014 19:50, Ferenc Kovacs wrote: >> >> Maybe it was already mentionex, but just to make sure: this would fix >> issues like https://bugs.php.net/bug.php?id=54547 >> > Yes, such comparison issues will go away! It would, however, in

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Marc Bennewitz
On 20.08.2014 19:50, Ferenc Kovacs wrote: > > 2014.08.17. 21:59 ezt írta ("Marc Bennewitz" ): >> >> Hi internals! >> >> I've created a draft RFC and patch to change the behavior of > non-strict string to string comparison to be binary safe (as the strict > comparison operator does): >> >> ht

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Marc Bennewitz
On 20.08.2014 12:46, Michael Wallner wrote: > On 20/08/14 11:12, Marc Bennewitz wrote:> >> >> On 18.08.2014 17:43, Johannes Schlüter wrote: >>> On Mon, 2014-08-18 at 17:30 +0200, Johannes Schlüter wrote: foreach ($db->query("SELECT id, title FROM entries") as $row) { echo ">>

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Michael Wallner
On 20/08/14 11:12, Marc Bennewitz wrote:> > > On 18.08.2014 17:43, Johannes Schlüter wrote: >> On Mon, 2014-08-18 at 17:30 +0200, Johannes Schlüter wrote: >>> foreach ($db->query("SELECT id, title FROM entries") as $row) { >>> echo ">> if ($row[0] == $_GET['highlight_id']) { >>>

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Tjerk Meesters
On Tue, Aug 19, 2014 at 11:07 AM, Tjerk Meesters wrote: > > On Mon, Aug 18, 2014 at 11:30 PM, Johannes Schlüter < > johan...@schlueters.de> wrote: > >> On Mon, 2014-08-18 at 23:09 +0800, Tjerk Meesters wrote: >> > > On 18 Aug, 2014, at 10:47 pm, Johannes Schlüter < >> johan...@schlueters.de> wrot

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Marc Bennewitz
On 19.08.2014 05:07, Tjerk Meesters wrote: On Mon, Aug 18, 2014 at 11:30 PM, Johannes Schlüter mailto:johan...@schlueters.de>> wrote: On Mon, 2014-08-18 at 23:09 +0800, Tjerk Meesters wrote: > > On 18 Aug, 2014, at 10:47 pm, Johannes Schlüter mailto:johan...@schlueters.de>> wrote

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Marc Bennewitz
On 18.08.2014 17:43, Johannes Schlüter wrote: On Mon, 2014-08-18 at 17:30 +0200, Johannes Schlüter wrote: foreach ($db->query("SELECT id, title FROM entries") as $row) { echo "".htmlentities($row[1]).""; } will suddenly fail. How wonderful! (irony) Just to make this more fun

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-20 Thread Marc Bennewitz
On 18.08.2014 14:53, Pierre Joye wrote: hi, On Mon, Aug 18, 2014 at 2:44 PM, Marc Bennewitz wrote: On 17.08.2014 22:18, Sara Golemon wrote: On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrote: I've created a draft RFC and patch to change the behavior of non-strict string to string c

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Tjerk Meesters
On Mon, Aug 18, 2014 at 11:30 PM, Johannes Schlüter wrote: > On Mon, 2014-08-18 at 23:09 +0800, Tjerk Meesters wrote: > > > On 18 Aug, 2014, at 10:47 pm, Johannes Schlüter < > johan...@schlueters.de> wrote: > > > > > >> On Mon, 2014-08-18 at 14:44 +0200, Marc Bennewitz wrote: > > >> The question

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Johannes Schlüter
On Mon, 2014-08-18 at 17:30 +0200, Johannes Schlüter wrote: >foreach ($db->query("SELECT id, title FROM entries") as $row) { >echo "if ($row[0] == $_GET['highlight_id']) { >echo " background='#ff'"; >} >echo ">".htmlentities($row[1]).""; >} >

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Johannes Schlüter
On Mon, 2014-08-18 at 23:09 +0800, Tjerk Meesters wrote: > > On 18 Aug, 2014, at 10:47 pm, Johannes Schlüter > > wrote: > > > >> On Mon, 2014-08-18 at 14:44 +0200, Marc Bennewitz wrote: > >> The question isn't "What's wrong with ===, strcmp()?" but "What's wrong > >> with ==, <, >?". > >> > >>

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Tjerk Meesters
> On 18 Aug, 2014, at 10:47 pm, Johannes Schlüter > wrote: > >> On Mon, 2014-08-18 at 14:44 +0200, Marc Bennewitz wrote: >> The question isn't "What's wrong with ===, strcmp()?" but "What's wrong >> with ==, <, >?". >> >> We have a standard way to compare two operands but currently we do some

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Johannes Schlüter
On Mon, 2014-08-18 at 14:44 +0200, Marc Bennewitz wrote: > The question isn't "What's wrong with ===, strcmp()?" but "What's wrong > with ==, <, >?". > > We have a standard way to compare two operands but currently we do some > magic things to solve something that don't need to be solved. Still

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Alain Williams
On Mon, Aug 18, 2014 at 02:44:36PM +0200, Marc Bennewitz wrote: > >What exactly is wrong with ===, strcmp(), etc..? > > The question isn't "What's wrong with ===, strcmp()?" but "What's > wrong with ==, <, >?". > > We have a standard way to compare two operands but currently we do > some magic t

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Pierre Joye
hi, On Mon, Aug 18, 2014 at 2:44 PM, Marc Bennewitz wrote: > > > On 17.08.2014 22:18, Sara Golemon wrote: >> >> On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrote: >>> >>> I've created a draft RFC and patch to change the behavior of non-strict >>> string to string comparison to be binary saf

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Marc Bennewitz
On 17.08.2014 22:18, Sara Golemon wrote: On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrote: I've created a draft RFC and patch to change the behavior of non-strict string to string comparison to be binary safe (as the strict comparison operator does): https://wiki.php.net/rfc/bina

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-18 Thread Julien Pauli
On Sun, Aug 17, 2014 at 9:58 PM, Marc Bennewitz wrote: > Hi internals! > > I've created a draft RFC and patch to change the behavior of non-strict > string to string comparison to be binary safe (as the strict comparison > operator does): > > https://wiki.php.net/rfc/binary_string_comparison

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-17 Thread Rasmus Lerdorf
On 8/17/14, 1:18 PM, Sara Golemon wrote: > On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrote: >> I've created a draft RFC and patch to change the behavior of non-strict >> string to string comparison to be binary safe (as the strict comparison >> operator does): >> >> https://wiki.php.ne

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-17 Thread Adrian Guenter
Type juggling is a (major) feature of PHP which would effectively be neutered by this change. As Sara mentioned we already have tools to achieve binary and string comparison. On Aug 17, 2014 4:19 PM, "Sara Golemon" wrote: > On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrote: > > I've created

Re: [PHP-DEV] [RFC] Binary String Comparison

2014-08-17 Thread Sara Golemon
On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrote: > I've created a draft RFC and patch to change the behavior of non-strict > string to string comparison to be binary safe (as the strict comparison > operator does): > > https://wiki.php.net/rfc/binary_string_comparison > If I understand

[PHP-DEV] [RFC] Binary String Comparison

2014-08-17 Thread Marc Bennewitz
Hi internals! I've created a draft RFC and patch to change the behavior of non-strict string to string comparison to be binary safe (as the strict comparison operator does): https://wiki.php.net/rfc/binary_string_comparison On comparing two numeric strings both operands will be equal if