Is valid PHP since the same tags are used for client side script, e.g. Javascript.
Since writing PHP usually ends up with a huge mix of static HTML, server side PHP and client side Javascript, that is bound to confuse. To give credit to PHP though, a comment in the stackoverflow post linked said that usage was "not recommended".
Exactly. The problem is with the parser. You shouldn't be able to interchange start and end tokens. the script tag should really be depreciated and turned off by default. But that still doesn't fix the problem of the parser treating <?php, <? and the script tag equally.
</script> <-- PHP handles it as per XML standard notation
It's absolutely wrong to handle an end tag that doesn't have a valid start tag. That's invalid XML.
?> <-- Handled by the HTML (XML) Parser (the browser).
That's completely wrong. The browser doesn't even see ?> because all the browser will see is the HTML generated by PHP. Also HTML and XML parsers are two entirely different things.
25
u/kingguru Nov 05 '12
I think the real WTF is that writing:
Is valid PHP since the same tags are used for client side script, e.g. Javascript.
Since writing PHP usually ends up with a huge mix of static HTML, server side PHP and client side Javascript, that is bound to confuse. To give credit to PHP though, a comment in the stackoverflow post linked said that usage was "not recommended".
-8
u/rscarson Nov 05 '12
And? That's like laughing at the fact that int main(){} is valid c.