Jump to content

Recommended Posts

<?php

is the only syntax i use. Right now as of very recently I picked up a project that is almost done but not quite, coder bailed, so while I am going through tryin to figure out his logic, I start coming across tags

 

<?=

like that, I never seen that tag before so I was wondering what it was.

 

as for

<?

I try to avoid using it like that as I know if the server isnt configured right it wont recognize it. or on a flip not some host providers completely null that out as it conflicts some places..

 

But hearing about

<? and <?= 

being depreciated.. makes me want to stay away from it more lol, but now im looking at it and sitting here stupid cause i gotta fix all that lol

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1176489
Share on other sites

EDIT: I see I was beaten to the submit button . . .  ^ ^ ^

 

It's easy to search and replace those in an editor.

 

1) replace '<?=' with '<? echo '

2) replace '<?' with '<?php'

3) replace '<?phpphp' with '<?php' (just in case there were already proper <?php tags already in the code.)

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1176492
Share on other sites

no, they used <?=

so that I have to fix throughout, as this software is developed with the intention of multiple systems not just the one its being built on.

 

You wouldnt happen to know which version of PHP <?= and or <? was depreciated in would you? or what version it gets written completely out of..

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1176493
Share on other sites

Its all good though, I really appreciate the quick answers from everyone. Yea the text editor bit or a grep search in general will take care of it all. But again I just wanted to ensure there wasn't some unknown logic to those tags being used as In my years I never seen them. Always <?php at worst <? only

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1176495
Share on other sites

deprecated - In computer software or authoring programs standards and documentation, the term deprecation is applied to software features that are superseded and should be avoided.

 

 

depreciated - refers to two very different but related concepts:

1. decline in value of assets, and

2. allocation of the cost of assets to periods in which the assets are used.

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1176498
Share on other sites

3) Change all <?php= to <?php echo
Note that this won't work.  Proper syntax:

 

<?=$var?>

<?php echo $var; ?>

Note the semicolon.

 

Also, BlueSkyIS is spot-on about deprecation. It means "still works but don't write NEW code with it," not "doesn't work."

 

-Dan

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1178186
Share on other sites

^^^ I have no idea what you mean in your post above, but if you read the whole thread and perform the suggested search/replace in the 1,2,3 sequence that was listed, <?= will become <?php= in step 1 and <?php= will become <?php echo in step 3.

 

 

Link to comment
https://forums.phpfreaks.com/topic/228138-php-tags/#findComment-1178190
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.