3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function sub_string($string, $start, $length) { $result = substr($string,$start,$length); return $result; } $test_string = '1978-02-16'; $year = sub_string($test_string,0,4);
Output for 4.3.0 - 7.2.0