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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -