Re: PHP_CompatInfo do not parse a strange PHP Syntax - Who can give me an explain ?
| From: | Gregory Beaver | Date: | Sat, 27 Sep 2008 21:12:27 +0000 |
| Subject: | Re: PHP_CompatInfo do not parse a strange PHP Syntax - Who can give me an explain ? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50804@lists.php.net to get a copy of this message | ||
Greg Sherwood wrote:
> On 27/09/2008, at 7:37 PM, Laurent Laville wrote:
>
>> Hello all,
>>
>> I've recently receive a bug report [1] from William Meleyal about
>> PHP_CompatInfo, who can not parse (currently with version 1.8.0) the
>> Kohana PHP Framework v2.2 [2].
>>
>> After a little analysis, the problem came from a file with a strange
>> syntax (for me).
>> The file "javascript" from the gmail module [3] has a syntax that I
>> have some difficulty to understand.
>>
>> If someone could explain me I'll be happy !
>>
>> Here are a bit of the code (syntax) that I cannot understand
>>
>> <?php echo $center, "\n" ?>
>
> The echo language construct can take multiple arguments to echo multiple
> strings. If you use it in this way, you cannot use parentheses, so
> echo($center, "\n"); would be invalid.
>
> There is a bit of an explanation on the echo doc page:
> http://www.php.net/echo
>
> I don't personally use the syntax myself, preferring string
> concatenation. It would be interesting to know if there is a speed
> difference.
Hi,
actually, echo with commas is faster than any other form of printing,
although it is highly unlikely to be the bottleneck in any application.
However, one never knows. A few years back I moved a large application
from "double quotes" to 'single quotes' and there was a noticeable
difference in speed (seconds) to the end user even without a profiler.
This was early PHP on a slow server though :)
Greg