3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "this is school of sachin". $pattern = "sch"; $words = explode(" ", $a); foreach($words as $word){ $pos = strpos(strrev($word), strrev($pattern)); if($pos !== false){ print(strlen($word)-$pos); break; } } ?>
Output for 4.3.0 - 7.1.0
3