note 32170 rejected from function.preg-match-all by alindeman
| From: | alindeman@php.net | Date: | Mon, 19 May 2003 21:03:36 +0000 |
| Subject: | note 32170 rejected from function.preg-match-all by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48612@lists.php.net to get a copy of this message | ||
Note Submitter: ben@slax0rnet.com
----
found a possible error in the above documentation:
the flag PREG_OFFSET_CAPTURE does not appear to work in PHP 4.3.0 as stated by the manual with
regards to preg_match_all().
Under PHP 4.3.0:
$str="<div>test</div><div>test2</div>";
preg_match_all("/(<div>)/i", $str, $starts, PREG_OFFSET_CAPTURE);
will throw the error:
Warning: Wrong value for parameter 4 in call to preg_match_all() in /path/to/script.php on line 2
preg_match() appears to work correctly using the same code, but without the benefits inherant in
preg_match()