Re: PHP code only allowed in XHTML 5?

Toby A Inkster On 09-07-22 10.33:

> On 22 Jul 2009, at 02:07, Leif Halvard Silli wrote:
> 
>> Suppose one wants to validate a page that embeds PHP, but that one 
>> wants to do so /prior/ to the execution of the PHP script:
>>
>>        <?php Print "Hello, World!"; ?>
>>
>> Validator.nu will then tell you that the page is _invalid_ as a HTML5 
>> page. But that it is valid as a XHTML5 page ... Also, checking the 
>> HTML 5 draft, you will find nothing about the <?> syntax.
> 
> 
> <p class="<?php echo 'foo';?>">
> 
> Invalid in both XHTML and HTML, but perfectly legal PHP.


No one has has claimed that _any_ PHP should be valid HTML. But 
regardless, according to Validator.w3.org, the above is actually 
perfectly legal HTML. But illegal XHTML.

> PHP's start and 
> end markers are not real XML processing instructions. They just look a 
> bit like them.


This was already evident from my message.
-- 
leif halvard silli

Received on Wednesday, 22 July 2009 09:09:39 UTC