On Sun, Nov 27, 2005 at 11:58:16AM +0100, Marcus Boerger wrote:
>
> To second this, the xml standard allows any name after '<?' as processing
> instruction. Widely in use is for example '<?jsp' and do you want to start
> special treatment for java stuff in PHP? ;-)
First, PHP scripts are not XML files, so why are we concerned with what
the XML standard says?
Second, PHP is frequently used to output XML files, necessitating such PHP
scripts contain the string "<?xml" in them. But in order to ensure
scripts work when short tags is on, one must write something contorted
like:
echo '<' . '?xml ...';
Third, if someone wrote a script using "<?xml" with short tags off instead
of the above, PHP needlessly fails if short tags is on, eliminating
portability.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Sunday 27 November 2005 22:20, Daniel Convissor wrote:
> First, PHP scripts are not XML files, so why are we concerned with what
> the XML standard says?
It isn't about the XML standard but about exceptions for the PHP parser and
why should <?xml be treated different from <?jsp or <?xsl or <?foo or ...
which all are used (hm, not sure about <?foo) and sometimes even in
combination with PHP.
> Second, PHP is frequently used to output XML files, necessitating such PHP
> scripts contain the string "<?xml" in them. But in order to ensure
> scripts work when short tags is on, one must write something contorted
> like:
>
> echo '<' . '?xml ...';
echo '<?xml ...';
just works fine.
> Third, if someone wrote a script using "<?xml" with short tags off instead
> of the above, PHP needlessly fails if short tags is on, eliminating
> portability.
so just remove short_tags :-)
johannes
<?foo();?>
And before you say "just watch for parens" there's also:
<?foo::bar();?>
and a much more insiduous example:
<?die ?>
no semicolon, no parens, no paamayim nekudotayim, nothing but a perfectly
valid looking PI tag.
-Sara
So a clean <?php= solution would be ideal, so I wouldn't have to care
about xml/xsl files parsed and neither about my templates growing too
large because of php overhead.
id like to see '<?php=' too.
marcus
Best regards,
Marcus
ron
"Marcus Boerger" <he...@php.net> wrote in message
news:793837231.20...@marcus-boerger.de...
I recall this being discussed before, but not what came of it: is there
a problem with just ignoring <?foo where foo is anything other than php
or =? <?foo or <?bar or <?whatever is a parse error anyway so I very
much doubt there's any BC break. Unless someone's program relies on
parse errors.
--
Mike
On Mon, 28 Nov 2005 20:29:42 +0100
Marcus Boerger <he...@php.net> wrote:
> Hello Bastian,
>
> id like to see '<?php=' too.
>
> marcus
>
> Monday, November 28, 2005, 9:56:56 AM, you wrote:
>
> > What concerns me most is that <?php= does not work, regardless if short
> > tags will be disabled or not in php6. I currently use <%= to counter
> > this, but I am most certainly *not* happy with it.
>
> > So a clean <?php= solution would be ideal, so I wouldn't have to care
> > about xml/xsl files parsed and neither about my templates growing too
> > large because of php overhead.
>
> > Sara Golemon wrote:
> >>> I recall this being discussed before, but not what came of it: is there
> >>> a problem with just ignoring <?foo where foo is anything other than php
> >>> or =? <?foo or <?bar or <?whatever is a parse error anyway so I very
> >>> much doubt there's any BC break. Unless someone's program relies on
> >>> parse errors.
> >>>
> >> The problem there becomes legacy support for:
> >>
> >> <?foo();?>
> >>
> >> And before you say "just watch for parens" there's also:
> >>
> >> <?foo::bar();?>
> >>
> >> and a much more insiduous example:
> >>
> >> <?die ?>
> >>
> >> no semicolon, no parens, no paamayim nekudotayim, nothing but a
> >> perfectly valid looking PI tag.
> >>
> >> -Sara
>
>
>
>
> Best regards,
> Marcus
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
Mike Hall
Twist Digital Media
e. mike...@twistdigital.co.uk
D I S C L A I M E R
Statements and opinions expressed in this e-mail may not represent those
of the company.
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender immediately and delete
the material from any computer.
as far as i remember the only arguemnt against <?php= was
that '=' is not a valid character for a XML processing instruction
name?
--
Hartmut Holzgraefe, Senior Support Engineer .
MySQL AB, www.mysql.com
Same at my company.
<?php= would be very nice.
--
Best regards,
Jason mailto:ja...@ionzoft.com
Wednesday, November 30, 2005, 4:31:58 AM, you wrote:
MH> Just FYI, the lack of <?php= is the only reason we don't disable short
MH> tags on all development projects at my company.
MH> Mike
MH> On Mon, 28 Nov 2005 20:29:42 +0100
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
MH> Mike Hall
MH> Twist Digital Media
MH> e. mike...@twistdigital.co.uk
MH> D I S C L A I M E R
MH> Statements and opinions expressed in this e-mail may not represent those
MH> of the company.
MH> The information transmitted is intended only for the person or entity to
MH> which it is addressed and may contain confidential and/or privileged
MH> material. Any review, retransmission, dissemination or other use of, or
MH> taking of any action in reliance upon, this information by persons or
MH> entities other than the intended recipient is prohibited. If you
MH> received this in error, please contact the sender immediately and delete
MH> the material from any computer.
Ron
"Jason Garber" <ja...@ionzoft.com> wrote in message
news:522821245.20...@ionzoft.com...
same here :-)
Would really be great if we could turn short_open_tags off and still
use the compact print syntax.
--Sebastian
oh, that's easy to solve '<?php' WS + '='
btw, th ejsp way is to have '<?jsp' '.' <action>
best regards
marcus
Wednesday, November 30, 2005, 10:44:37 AM, you wrote:
> Mike Hall wrote:
>> Just FYI, the lack of <?php= is the only reason we don't disable short
>> tags on all development projects at my company.
> as far as i remember the only arguemnt against <?php= was
> that '=' is not a valid character for a XML processing instruction
> name?
> --
> Hartmut Holzgraefe, Senior Support Engineer .
> MySQL AB, www.mysql.com
Best regards,
Marcus
If you want to be able to use '<?php=' you should go to W3C.org. There's
where the XHTML/XML specs are defined.
If people change their code from '<?' to '<?php' then, while they're at
it, they might just as well change it to '<?php echo'. It's just a teeny
little bit more code but it makes sure that your documents remain
standards compliant.
If you really don't like to use '<?php echo' and don't care about
standards compliance, I'd suggest you keep short tags enabled.
Sebastian Kugler wrote:
> On 11/30/05, Ron Korving <r.ko...@xit.nl> wrote:
>
>>Same for our company. We still use <? because of <?=
>
>
> same here :-)
>
> Would really be great if we could turn short_open_tags off and still
> use the compact print syntax.
>
> --Sebastian
--
Marcus Boerger wrote:
> Hello Hartmut,
>
> oh, that's easy to solve '<?php' WS + '='
>
> btw, th ejsp way is to have '<?jsp' '.' <action>
>
> best regards
> marcus
>
> Wednesday, November 30, 2005, 10:44:37 AM, you wrote:
>
>
>>Mike Hall wrote:
>>
>>>Just FYI, the lack of <?php= is the only reason we don't disable short
>>>tags on all development projects at my company.
>
>
>>as far as i remember the only arguemnt against <?php= was
>>that '=' is not a valid character for a XML processing instruction
>>name?
>
>
>
>>--
>>Hartmut Holzgraefe, Senior Support Engineer .
>>MySQL AB, www.mysql.com
>
>
>
>
>
> Best regards,
> Marcus
--
:)
Ah, but the whitespace is already meaningful (-:
sean@iconoclast:~$ echo '<?php echo"foo\n";?>' | php -d short_open_tag=0
foo
sean@iconoclast:~$ echo '<?phpecho"foo\n";?>' | php -d short_open_tag=0
<?phpecho"foo\n";?>
S
Processing Instruction: phpecho
We're talking about the PHP language. Not the PHP engine. You're right that
the PHP engine needs to be capable of finding its processing instructions.
So it's capable of doing a little XML. Thus it needs to understand the
meaning of whitespace in XML.
However, that's the PHP engine doing XML syntax. Not processing PHP syntax.
It's defined in the XML spec that the end of the name of a Processing
Instruction is marked with a whitespace:
http://www.w3.org/TR/REC-xml/#sec-pi
There it states:
PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
S meaning Whitespace.
So, that whitespace is meaningfull for XML. Not for PHP. PHP couldn't care
less how processing instructions are defined in XML.
I could not care less if the php source code is valid xml, what
matters is the output. Anyway, if people use <?php instead of <?=3D
things are not getting worse for xml purists. Also, PHP tags are
allowed where PIs are not, and PHP code can include ?> without
problems whithout closing the PI.
Regards,
Stefan