3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = 39983; $strLength = strlen($id); echo str_pad(39983, 4, "0", STR_PAD_LEFT);

preferences:
43.18 ms | 402 KiB | 5 Q