/    Sign up×
Community /Pin to ProfileBookmark

i have been speaking to a few people recently about the use of <?php and <?

is there any need for <?php (somone said its supposed to be used for again now were in php5?)

just wanted to have it cleared up is it bad practice to use <? instead?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@SheldonOct 24.2006 — <?php is the long tag, It is reccomended for open applications where the installation may be on many different systems.

<? is the short php tag and is not enabled by default on all PHP builds. It in some cases needs to enabled in the php.ini, which is not avilable to edit on all servers (virtual hosting...)
Copy linkTweet thisAlerts:
@NogDogOct 24.2006 — Just to amplify on what Sheldon wrote: [b]<?php[/b] will work on all PHP installations, [b]<?[/b] may or may not work. So, you can make your code more portable (and save a lot of potential headaches in the future) if you use the long form even if your server currently supports the short form.
Copy linkTweet thisAlerts:
@pcthugOct 24.2006 — Also, XML parsers are confused by the shorthand syntax.
×

Success!

Help @knowj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...