note 119199 added to function.substr-count
| From: | tuxedobob | Date: | Mon, 18 Apr 2016 18:55:23 +0000 |
| Subject: | note 119199 added to function.substr-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205268@lists.php.net to get a copy of this message | ||
It's worth noting this function is surprisingly fast. I first ran it against a ~500KB string on
our web server. It found 6 occurrences of the needle I was looking for in 0.0000 seconds. Yes, it
ran faster than microtime() could measure.
Looking to give it a challenge, I then ran it on a Mac laptop from 2010 against a 120.5MB string.
For one test needle, it found 2385 occurrences in 0.0266 seconds. Another test needs found 290
occurrences in 0.114 seconds.
Long story short, if you're wondering whether this function is slowing down your script, the
answer is probably not.
----
Server IP: 72.52.91.14
Probable Submitter: 96.233.109.34
----
Manual Page -- http://php.net/manual/en/function.substr-count.php
Edit -- https://master.php.net/note/edit/119199
Del: integrated -- https://master.php.net/note/delete/119199/integrated
Del: useless -- https://master.php.net/note/delete/119199/useless
Del: bad code -- https://master.php.net/note/delete/119199/bad+code
Del: spam -- https://master.php.net/note/delete/119199/spam
Del: non-english -- https://master.php.net/note/delete/119199/non-english
Del: in docs -- https://master.php.net/note/delete/119199/in+docs
Del: other reasons-- https://master.php.net/note/delete/119199
Reject -- https://master.php.net/note/reject/119199
Search -- https://master.php.net/manage/user-notes.php