FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » HP syntax error, unexpected T_variable
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: HP syntax error, unexpected T_variable [message #179906 is a reply to message #179903] Tue, 18 December 2012 16:50 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 12/18/2012 8:11 AM, M. Strobel wrote:
> Am 18.12.2012 13:10, schrieb Jerry Stuckle:
>> On 12/18/2012 6:36 AM, M. Strobel wrote:
>>> Am 18.12.2012 01:51, schrieb Jerry Stuckle:
>>>> On 12/17/2012 6:51 PM, Thomas 'PointedEars' Lahn wrote:
>>>> > Twayne wrote:
>>>> >
>>>> >> […]
>>>> >> PHP 5.3.5 on XP Pro SP3+, Apache 2.2 local server.
>>>> >>
>>>> >> ------------------------
>>>> >>
>>>> >> <?php
>>>> >> if(isset($_POST['email'])) {
>>>> >>
>>>> >> $email_to=me(at)example(dot)com;
>>>> > ^ ^
>>>> >> /*
>>>> >> Parse error: syntax error, unexpected T_VARIABLE in
>>>> >> C:\xampp\htdocs\send.php on line 5
>>>> >> */
>>>> >> ...
>>>> >> ?>
>>>> > ^^
>>>> > Superfluous and error-prone at the end of a file. Also, there should be a
>>>> > “}” before it to end the block of the “if” statement.
>>>> >
>>>>
>>>> Maybe you consider it superfluous, but GOOD programmer close their code at the end.
>>>> Of course, we know YOU don't.
>>>>
>>>
>>> Zend Framework does not use ?> in PHP only files. Just checked.
>>>
>>> /Str.
>>>
>>
>> I rest my case.
>
> Just for the many readers,
>
> the problem with the closing tag is, that you get difficult to control newlines and
> spaces in the output.
>
> This is hardly noticeable in HTML, but a big problem when serving binary files.
>
> /Str.
>
>

It is not a problem for good programmers. They know not to place
newline characters after the ?>. Additionally, if one sneaks in, the
error message generated is QUITE clear.

And BTW - PHP scripts are NOT "binary files".

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Gettting values from URL in PHP 5.4
Next Topic: passing values into javascript
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 20:26:45 GMT 2024

Total time taken to generate the page: 0.04061 seconds