From 008810dc294f9870b8c53b7d5cf1b9fa41b1f65f Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Mon, 4 Oct 1999 13:04:32 +0000 Subject: [PATCH] ereg now returns a continious array 0..9 again - empty values are returned as false. i think this is *more* compatible with PHP3 - unless anybody really dislikes it i'd prefer it like this. --- ChangeLog | 1 + ext/ereg/ereg.c | 2 ++ ext/standard/reg.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index a99164d6af..ad8a80d5b9 100644 --- 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. diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 6382cfd739..c9f84ed973 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -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); diff --git a/ext/standard/reg.c b/ext/standard/reg.c index 6382cfd739..c9f84ed973 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -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); -- 2.49.0