3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Positive numbers: echo substr("Hello world",10)."<br>"; echo substr("Hello world",1)."<br>"; echo substr("Hello world",3)."<br>"; echo substr("Hello world",7)."<br>"; echo "<br>"; // Negative numbers: echo substr("Hello world",-1)."<br>"; echo substr("Hello world",-10)."<br>"; echo substr("Hello world",-8)."<br>"; echo substr("Hello world",-4)."<br>"; ?>
Output for 4.3.0 - 7.2.0
d<br>ello world<br>lo world<br>orld<br><br>d<br>ello world<br>lo world<br>orld<br>