What are the potential pitfalls of using PHP 4 for string manipulation tasks like extracting substrings?

One potential pitfall of using PHP 4 for string manipulation tasks like extracting substrings is that PHP 4 is no longer supported and may contain security vulnerabilities. To solve this issue, it is recommended to upgrade to a newer version of PHP, such as PHP 7, which has improved functionality and security features.

// PHP 7 code snippet for extracting substrings
$string = "Hello, World!";
$substring = substr($string, 7, 5);
echo $substring; // Output: World