#29712 [Csd->Opn]: ereg() does not return TRUE
| From: | liit at geeksbynature dot dk | Date: | Sun, 29 Aug 2004 16:10:03 +0000 |
| Subject: | #29712 [Csd->Opn]: ereg() does not return TRUE | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969363566@lists.php.net to get a copy of this message | ||
ID: 29712
User updated by: liit at geeksbynature dot dk
Reported By: liit at geeksbynature dot dk
-Status: Closed
+Status: Open
Bug Type: Documentation problem
Operating System: Gentoo Linux
PHP Version: 4.3.8
New Comment:
ereg() still only returns int(1) or (boolean)FALSE. I've expanded my
test-script a bit:
<?php
$a = ereg("fo","fo"); // Simple test to see if documentation is right
(it's not)
$b = ereg("bar","foobarbar"); // Is it the position of the first
result, that is returned ? (no)
$c = ereg("foo","bar"); // A negative test (works)
echo $a . ":" . gettype($a). "\n";
echo $b . ":" . gettype($b). "\n";
echo $c . ":" . gettype($c). "\n";
?>
Result:
1:integer
1:integer
:boolean
According to the docs, it should be:
2:integer
3:integer
:boolean
Previous Comments:
------------------------------------------------------------------------
[2004-08-17 00:40:12] tomsommer@php.net
This bug has been fixed in the documentation's XML sources.
The changes may not appear immediately, since the online and
downloadable versions of the documentation need some time to get
updated. We would therefore like to ask for your patience in this
matter.
Thank you for the report, and for helping us make our documentation
better.
------------------------------------------------------------------------
[2004-08-17 00:12:47] iliaa@php.net
ereg() returns the length of the matched string on success,
the documentation is wrong.
------------------------------------------------------------------------
[2004-08-16 20:57:24] liit at geeksbynature dot dk
Description:
------------
The function ereg() either returns (boolean)FALSE or (int)1, and not
(boolean)FALSE or (boolean)TRUE
Reproduce code:
---------------
echo gettype(ereg("foo","foo"));
echo gettype(ereg("foo","bar"));
Expected result:
----------------
boolean
boolean
Actual result:
--------------
integer
boolean
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29712&edit=1