|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesgetregex.diff (last revision 2011-01-05 22:01 UTC by jthijssen at noxlogic dot nl)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-06 02:47 UTC] aharvey@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: aharvey
[2011-01-06 02:47 UTC] aharvey@php.net
[2011-01-06 03:32 UTC] aharvey@php.net
[2011-01-06 03:33 UTC] aharvey@php.net
-Status: Assigned
+Status: Closed
[2011-01-06 03:33 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 01:00:01 2025 UTC |
Description: ------------ I'd like to see an getRegex() method in the regexIterator class that will return the regular expression that is initialized during its __construct(). Currently there is no way of retrieving that information except for saving it yourself outside the object or extending regexiterator in order to save the regex inside a custom constructor. It would be nice if the information about the object could actually be retrieved natively since this data is already present, just not visible to the outside world. Attached is a patch with an implementation. Test script: --------------- $array = array('cat', 'hat', 'sat'); $iterator = new ArrayIterator($array); $regexIterator = new RegexIterator($iterator, '/.at/'); var_dump($regexIterator->getRegex()); Expected result: ---------------- string(5) "/.at/" Actual result: -------------- PHP Fatal error: Call to undefined method ArrayIterator::getRegex()