php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46725 strpos extensions with array type parameters
Submitted: 2008-12-01 15:28 UTC Modified: -
Votes:5
Avg. Score:4.2 ± 1.6
Reproduced:3 of 4 (75.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: php at pk dot freesurf dot fr Assigned:
Status: Open Package: Feature/Change Request
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at pk dot freesurf dot fr
New email:
PHP Version: OS:

 

 [2008-12-01 15:28 UTC] php at pk dot freesurf dot fr
Description:
------------
a) strpos($haystack, $t_needle, $offset) will return position of the first $t_needle element found ...

b) strpos($t_haystack, $t_needle, $t_offset) will return an array of corresponding position...

the a) will be very usefull for me ( very cpu time consuming when $t_haystack is about 1 MB and sizeof($t_needle) is great, the haystack is to be scan as many times as the sizeof($t_needle) when I do this within a loop with the current strpos implementation).
Then proposal will need only 1 time scanning ... and it could be possible to optimize the search by pre-scanning the $t_needle array and generate an "automate" that will search for 1 character and then the 2nd one to be just after, and so on...

the b) suggestion is only for the code "beauty"...

(forgive my poor english, I'm french...)


Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 07:01:28 2024 UTC