I wanted to discuss this bug to try to get it resolved.  I briefly discussed
this over ICQ and had differing opinions then the person I was talking to,
so naturally I wanted a bigger audience.

Quick summary of what's going on:
* 47643 is about array_diff being slow.
* This was caused by the patch for 42838
* The problem with 42838 is basically that 0 != '0'
* Here is the diff: http://www.lonnylot.com/42838.diff
 The lines that causes the slowdown are:

-                               while (*ptrs[i] && (0 < (c = 
diff_data_compare_func(ptrs[0],
ptrs[i] TSRMLS_CC)))) {
-                                       ptrs[i]++;
+                               while (*ptr && (0 < (c = 
diff_data_compare_func(ptrs[0], ptr
TSRMLS_CC)))) {
+                                       ptr++;
                                }


I feel the fix should be reverting 42838 because I feel 42838 wasn't a code
issue, but a documentation issue. It is noted in some places that comparing
a string to an integer results in the string being changed to 0. That is the
issue in 42838 and b/c this is excepted in other places it should be
excepted here. The documentation should be updated to say to typecast your
comparison to (string) if it is going to be important to your code.

Reply via email to