It is possible to install PHP 5.6.x along with the now PHP 7.2, with some caveats.
You have to grab the 14.2 slackbuild and adapt it on using i.e.
/opt/php56 as target for the installation of your custom PHP.
Bear in mind that YOU CANNOT install both (the native) PHP 7.2 and (your custom) PHP 5.6 in the
/usr, it is a big NO-NO, but installing in
/opt, you can even have multiple PHP versions.
Also, I do not think that issues like you describe could occur.
PS. I attached to this post an archive with my current build script for
PHP 5.6, installed in
/opt/php5.
Of course, lacks the PHP source tarball, being too big to be attached here.
Also, to note that's a
TAR.XZ archive, renamed as
.txt, for making the LQ site happy. Use at your risk, after a careful inspection.