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
Post a Comment