Bug #16763 Updated: '?=', and '%=' are equivalent to echo, but '?php=' is not

2002-04-26 Thread tbrinkman

 ID:   16763
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: Documentation problem
 Operating System: ALL
 PHP Version:  4.2.0
 New Comment:

Actually, removing ?= wouldn't improve consistency unless you also
removed %=.  Nobody, it seems, is actually willing to remove the short
hand, so the only way to improve consistency is to support it in all
three cases.  People who don't like the shorthand method will continue
to act as if it doesn't exist.  People who do like the shorthand method
will no longer have to write code using an optional tag style which
requires an ini setting which is NOT set on every(or even most?)
servers.


Previous Comments:


[2002-04-25 20:09:34] [EMAIL PROTECTED]

Removing ?= and %= works, too ;)

We are sure now. There will be people curious about not having ?php=,
since there are ?= and %=.

It looks we are better to document about echo short cut, explicitly.





[2002-04-25 19:27:03] [EMAIL PROTECTED]

Removing ?= would also improve consistency.

I don't buy the consistency argument.



[2002-04-25 19:13:34] [EMAIL PROTECTED]

I porposed the same thing monthes ago. I agree. It's strange not to
have ?php= since ?php tag is the only portable tag.

Anyway, in PHP, there are too many inconsistency to note and it's one
of them.





[2002-04-25 17:36:03] [EMAIL PROTECTED]

Do you mind if I ask why not?  It's half-way implemented as it stands. 
Both of the 'short form' tags support the behavior, what was the
reasoning behind not supporting it in the 'long form' tag?

Other than Rasmus's claim that he '...can't think of anything uglier
and less sensical  If that was the reason for not fully supporting
the form, why was it partially implemented in the first place?



[2002-04-23 15:22:44] [EMAIL PROTECTED]

this was discussed to death on php-dev. it's not going to happen.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/16763

-- 
Edit this bug report at http://bugs.php.net/?id=16763edit=1




Bug #16763 Updated: '?=', and '%=' are equivalent to echo, but '?php=' is not

2002-04-25 Thread tbrinkman

 ID:   16763
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: ALL
 PHP Version:  4.2.0
 New Comment:

Do you mind if I ask why not?  It's half-way implemented as it stands. 
Both of the 'short form' tags support the behavior, what was the
reasoning behind not supporting it in the 'long form' tag?

Other than Rasmus's claim that he '...can't think of anything uglier
and less sensical  If that was the reason for not fully supporting
the form, why was it partially implemented in the first place?


Previous Comments:


[2002-04-23 15:22:44] [EMAIL PROTECTED]

this was discussed to death on php-dev. it's not going to happen.



[2002-04-23 15:05:37] [EMAIL PROTECTED]

Seeing as how '?=' and '%=' are both equivalent to '?php echo', I
kind of figure that '?php=' should also be equivalent, but it is not.

Having run into this before, I asked about it and somebody told me it
was in the works to get taken care of for 4.2.0.  I checked and it
doesn't seem to be fixed, so I decided to do a bit of hunting to see if
it was within my capabilites.  I *think* I've found the changes which
need to be made, but I'm not absolutely certain.

Having searched through all of the source code for all occurrances of
'%=' and '?=', I discovered that they only exist (outside of
comments) in one source file.

That said, I *believe* that the following changes to
php-4.2.0\Zend\zend_language_scanner.l would cause '?php=' to become
equivalent to '?php echo' just as the other, shorter tags allow.

I don't know how to make an actual patch file, or where to submit it so
here goes.  First is the two-line change to zend_language_scanner.l
that would seem to enable the shorthand.  Second is the one-line change
to zend_language_scanner.c (just in case the two have to be maintained
seperately).
This should be easily back-portable to previous code trees.

file: php-4.2.0\Zend\zend_language_scanner.l;
replace: lines 941-942;
- - - - - START - - - - -
INITIAL%=|?=|?php= {
if ((yytext[1]=='%'  CG(asp_tags)) || (yytext[1]=='?' 
CG(short_tags)) || (yytext[1]=='?'  yytext[2]=='p'  yytext[3]=='h'
 yytext[4]=='p')) {
- - - - - STOP - - - - -

file: php-4.2.0\Zend\zend_language_scanner.c;
replace: line 4086;
- - - - - START - - - - -
if ((yytext[1]=='%'  CG(asp_tags)) || (yytext[1]=='?' 
CG(short_tags)) || (yytext[1]=='?'  yytext[2]=='p'  yytext[3]=='h'
 yytext[4]=='p')) {
- - - - - STOP - - - - -





-- 
Edit this bug report at http://bugs.php.net/?id=16763edit=1




Bug #16763: '?=', and '%=' are equivalent to echo, but '?php=' is not

2002-04-23 Thread tbrinkman

From: [EMAIL PROTECTED]
Operating system: ALL
PHP version:  4.2.0
PHP Bug Type: Feature/Change Request
Bug description:  '?=', and '%=' are equivalent to echo, but '?php=' is not

Seeing as how '?=' and '%=' are both equivalent to '?php echo', I kind
of figure that '?php=' should also be equivalent, but it is not.

Having run into this before, I asked about it and somebody told me it was
in the works to get taken care of for 4.2.0.  I checked and it doesn't
seem to be fixed, so I decided to do a bit of hunting to see if it was
within my capabilites.  I *think* I've found the changes which need to be
made, but I'm not absolutely certain.

Having searched through all of the source code for all occurrances of
'%=' and '?=', I discovered that they only exist (outside of comments)
in one source file.

That said, I *believe* that the following changes to
php-4.2.0\Zend\zend_language_scanner.l would cause '?php=' to become
equivalent to '?php echo' just as the other, shorter tags allow.

I don't know how to make an actual patch file, or where to submit it so
here goes.  First is the two-line change to zend_language_scanner.l that
would seem to enable the shorthand.  Second is the one-line change to
zend_language_scanner.c (just in case the two have to be maintained
seperately).
This should be easily back-portable to previous code trees.

file: php-4.2.0\Zend\zend_language_scanner.l;
replace: lines 941-942;
- - - - - START - - - - -
INITIAL%=|?=|?php= {
if ((yytext[1]=='%'  CG(asp_tags)) || (yytext[1]=='?' 
CG(short_tags)) || (yytext[1]=='?'  yytext[2]=='p'  yytext[3]=='h' 
yytext[4]=='p')) {
- - - - - STOP - - - - -

file: php-4.2.0\Zend\zend_language_scanner.c;
replace: line 4086;
- - - - - START - - - - -
if ((yytext[1]=='%'  CG(asp_tags)) || (yytext[1]=='?' 
CG(short_tags)) || (yytext[1]=='?'  yytext[2]=='p'  yytext[3]=='h' 
yytext[4]=='p')) {
- - - - - STOP - - - - -

-- 
Edit bug report at http://bugs.php.net/?id=16763edit=1
-- 
Fixed in CVS:http://bugs.php.net/fix.php?id=16763r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=16763r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=16763r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16763r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16763r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16763r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16763r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16763r=submittedtwice




Bug #16663 Updated: Different syntax for embedding HTML in PHP

2002-04-23 Thread tbrinkman

 ID:   16663
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Linux
 PHP Version:  4.2.0
 New Comment:

Don't think of it as including HTML in PHP.  Think of it as including
PHP in HTML.  That way you have your block-level delimiters as the
standard PHP start/end tags.

Whether this is a problem is completely dependant on your point of
view.


Previous Comments:


[2002-04-17 17:39:12] [EMAIL PROTECTED]

Well, I found another bug report #8685 which clued me in about where to
find the documentation for this type of
construct, which is a heredoc text entry.  Interestingly,
the other report was also from someone trying to write readable,
block-structured code, and was also classified as bogus.  I guess us
old guys who were around when Pascal was invented just have some weird
ideas about how code should be organized to be people friendly.



[2002-04-17 17:00:04] [EMAIL PROTECTED]

There is nothing wrong with your alternative except that I can't find
info about the contstruct

echo HTML
some more html
HTML

in the online documentation.  Should I add this to the notes regarding
Example 5-2. Advanced escaping on

http://www.php.net/manual/en/language.basic-syntax.php

in the online documentation, since this is apparently an additional
method for disabling the PHP parser ?

NOTE: I did try to search the online documentation for  without
any result. I also spoke to a PHP programmer with considerably more
experience than me, who was also unfamiliar with this construct.



[2002-04-17 16:01:32] [EMAIL PROTECTED]

What's wrong with

?php
  echo Ene mene foobr /\n;
  echo HTML
hr
Some more html
hr
HTML

?

Any, unlikely SUCH a change is done. Ever. :-)



[2002-04-17 12:29:12] [EMAIL PROTECTED]

I can't seem to figure out how to edit the submission,
so I can't fix the missing  on html



[2002-04-17 12:24:55] [EMAIL PROTECTED]

Missed the opening  on html



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/16663

-- 
Edit this bug report at http://bugs.php.net/?id=16663edit=1