3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test($str, $substr) { var_dump(strpos(substr($str,1), $substr)); return strpos(substr($str,1), $substr) >= 0; } function test2($str, $substr) { return strpos($str, $substr) > 0; } $str = 'hello'; $sub = 'he'; var_dump( test($str, $sub), test2($str, $sub) ); ?>
based on Jg0Pq
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(false) bool(true) bool(false)