]> granicus.if.org Git - php/commitdiff
ereg now returns a continious array 0..9 again - empty values are returned as false.
authorThies C. Arntzen <thies@php.net>
Mon, 4 Oct 1999 13:04:32 +0000 (13:04 +0000)
committerThies C. Arntzen <thies@php.net>
Mon, 4 Oct 1999 13:04:32 +0000 (13:04 +0000)
i think this is *more* compatible with PHP3 - unless anybody really dislikes it i'd prefer it like this.

ChangeLog
ext/ereg/ereg.c
ext/standard/reg.c

index a99164d6af1ff0e565d239839aced4014b639946..ad8a80d5b9d7214d7f0199c4dd739722815d9586 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ PHP 4.0 CHANGE LOG                                                    ChangeLog
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ?? ?? 1999, Version 4.0 Beta 3
+- Fixed backwards incompatibility with ereg() (Thies)
 - Updated Zend garbage collection with a much more thorough method.
   (Andi, Zend library)
 - Added the ability to use variable references in the array() construct.
index 6382cfd73989ce7e44a1403a503423da2f18aae5..c9f84ed9732bccc138712f7b8bad22effb909f71 100644 (file)
@@ -261,6 +261,8 @@ static void _php3_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
                        end = subs[i].rm_eo;
                        if (start != -1 && end > 0 && start < string_len && end < string_len && start < end) {
                                add_index_stringl(array, i, string+start, end-start, 1);
+                       } else {
+                               add_index_bool(array, i, 0);
                        }
                }
                efree(buf);
index 6382cfd73989ce7e44a1403a503423da2f18aae5..c9f84ed9732bccc138712f7b8bad22effb909f71 100644 (file)
@@ -261,6 +261,8 @@ static void _php3_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
                        end = subs[i].rm_eo;
                        if (start != -1 && end > 0 && start < string_len && end < string_len && start < end) {
                                add_index_stringl(array, i, string+start, end-start, 1);
+                       } else {
+                               add_index_bool(array, i, 0);
                        }
                }
                efree(buf);