Jump to content

PHP 7 vs PHP 5 syntax issue


Recommended Posts

In PHP 5, I conventionally opened my pages with <?php but within the pages I often used <? to open a php block, e.g., <?echo $variable; ?>.

In PHP 7, I find it is necessary to always use <?php and follow it with  a space, e.g., <?php echo $variable; ?>

I haven't been able to find any reference to this syntax change so my question:  Is this a new requirement of PHP 7? Can it be turned off?

Otherwise, I will need to edit all of the sites where my earlier habit was used, which I think I can do but would feel compelled to spend some hours testing afterward.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...