note 35409 deleted from function.strpos by tularis

From: Date: Wed, 22 Aug 2007 13:27:30 +0000
Subject: note 35409 deleted from function.strpos by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-129702@lists.php.net to get a copy of this message
Note Submitter: daijoubu at videotron dot ca ---- To previous comments: I did a test with 500000 iterations, string lenght was 1846bytes long and the word to find was near the end. Results: if (*) Total time in secs Average strpos($test, 'Possibly') === true 5.1114 0.0000102228 strpos(' '.$test, 'Possibly') > 1 7.2559 0.0000145117 is_int(strpos($test, 'Possibly')) 5.5331 0.0000110661 strstr($test, 'Possibly') 5.1461 0.0000102922 Clearly shows that === operator is the fastest

« previous php.notes (#129702) next »