Why this is causing PHP syntax error? -


the following code:

$a = '?>'; 

is fine commented version of same code:

//$a = '?>'; 

causes syntax error but

 /*$a = '?>';*/ 

is fine.

it doesn't make sense me how //$a = '?>'; translated.

from php docs:

the "one-line" comment styles comment end of line or current block of php code, whichever comes first.

(my emphasis)

the comment comprises block of characters

//$a = ' 

but ?> terminates comment, means have line of php reading just

'; 

which invalid php


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -