PAS2PHP
Transpiles/Converts Pascal to Working PHP Source Code
... is to understand the limitations of PHP. Read the example code provided, and always check the outputed PHP code to understand how this works.
As a guide to what PAS2PHP can achieve... my web site is written in Pascal, and then converted to PHP. (The code is in the source package). PAS2PHP uses the Pascal Parse Tree Classes (PasTree) which comes with FreePascal, and therefore the parsing limits are defined by this library.