nbell12 / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

PHP support #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Philip says,

> Any chance you add support for those ugly PHP variables in the form of
> $this? Yeah, I hate PHP too, I still use it because it's better
> supported than Python on my server :)

Original issue reported on code.google.com by mikesamuel@gmail.com on 22 Mar 2007 at 8:08

GoogleCodeExporter commented 8 years ago
I don't know much PHP but there seems to be a grammar at
http://www.csci.csusb.edu/dick/samples/php.syntax.html#PHP%20Identifiers

It seems to differ from perl in that identifiers don't start with [$@%] instead
starting with $+.

Strings ( http://www.csci.csusb.edu/dick/samples/php.syntax.html#Scalar%20Types 
)
start and end with quotes, so there's no need to try and handle perl strings 
which
would break every other language.

Can you point me at a code sample that illustrates good PHP style?

And how does PHP embed in html?  Is it the <? ... ?> or and <?php ... ?> style 
embedding?

Original comment by mikesamuel@gmail.com on 22 Mar 2007 at 8:11

GoogleCodeExporter commented 8 years ago
Depends on which php version your using.

php4
-----
<? and ?>

php5
-----
<?php and ?>

Original comment by dirg...@gmail.com on 23 Mar 2007 at 12:55

GoogleCodeExporter commented 8 years ago
I believe that you should make it only for <?php ?>
dirgesh: this works for php4 too. 
Your was is a very old way and I doubt that the majority use it anyway.

Original comment by vykintas...@googlemail.com on 23 Mar 2007 at 7:40

GoogleCodeExporter commented 8 years ago
What? Lots of people use <? and ?>, and also syntax such as <?=$foo?> for a 
quick echo.

Original comment by maxwell....@gmail.com on 23 Mar 2007 at 4:56

GoogleCodeExporter commented 8 years ago
I believe this is fixed.  Changes recorded at
http://google-code-prettify.googlecode.com/svn/trunk/CHANGES.html

Please see tests at
http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html#PH
P

Original comment by mikesamuel@gmail.com on 2 Apr 2007 at 6:41