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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...