View Single Post
Old 06-01-2014, 06:09 PM  
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,620
Quote:
Originally Posted by edgeprod View Post
This is not a good solution for business use. strstr() is more memory-intensive than strpos(), and thus slower and less scalable. Here's some benchmarking:

http://net-beta.net/ubench/index.php?t=strpos1

From the PHP manual: "If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead."

You may want to research functions you use more carefully, if you're creating anything but the smallest programs for personal use. I wouldn't accept this choice from a contractor, personally.
blackmonsters is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote