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

2014-08-21 Thread Andrea Faulds
On 17 Aug 2014, at 20:58, Marc Bennewitz php@mabe.berlin 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

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 php@mabe.berlin wrote: On 17.08.2014 22:18, Sara Golemon wrote: On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz php@mabe.berlin wrote: I've created a draft RFC and patch to change the behavior

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 trtd; if ($row[0] == $_GET['highlight_id']) { echo background='#ff'; }

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 johan...@schlueters.de 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

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

2014-08-20 Thread Tjerk Meesters
On Tue, Aug 19, 2014 at 11:07 AM, Tjerk Meesters tjerk.meest...@gmail.com 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

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 trtd; if ($row[0] == $_GET['highlight_id']) {

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 trtd; if

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 php@mabe.berlin): 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):

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

2014-08-20 Thread Andrea Faulds
On 20 Aug 2014, at 19:36, Marc Bennewitz php@mabe.berlin 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,

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

2014-08-18 Thread Julien Pauli
On Sun, Aug 17, 2014 at 9:58 PM, Marc Bennewitz php@mabe.berlin 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):

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 php@mabe.berlin 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):

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 php@mabe.berlin wrote: On 17.08.2014 22:18, Sara Golemon wrote: On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz php@mabe.berlin wrote: I've created a draft RFC and patch to change the behavior of non-strict string to string comparison

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 things to

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 it is a

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

2014-08-18 Thread Tjerk Meesters
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 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

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 johan...@schlueters.de 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

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 trtd; if ($row[0] == $_GET['highlight_id']) { echo background='#ff'; } echo .htmlentities($row[1])./td/tr; }

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 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 wrote: On Mon, 2014-08-18 at 14:44 +0200, Marc Bennewitz wrote: The

[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

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

2014-08-17 Thread Sara Golemon
On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz php@mabe.berlin 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

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 poll...@php.net wrote: On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz

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 php@mabe.berlin 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):