What are you trying to unset? Or more importantly, how are you using unset() [php.net]?
|Note that in PHP 3, unset() will always return |
TRUE (actually, the integer value 1). In PHP 4, however, unset() is no longer a true function: it is now a statement. As such no value is returned, and attempting to take the value of unset() results in a parse error.
The User Contributed notes also makes a good statement:
|As of PHP version 4.3.3, unset() results in a parse error if it is used with the @ error suppression operator. |
@unset($var); // parse error
unset(@$var); // parse error
unset($var); // okay
This is because the @-operator works only on expressions [php.net]. A simple rule of thumb is: if you can take the value of something, you can prepend the @ operator to it. (Error Control Operators [php.net])
I'm not trying to unset anything. What is happening is that I have two php applications that I've installed - one widely used BB. I have them installed on other servers and they work absolutely flawless.
I just setup my own VPS and have uploaded these and in each case the only error that I'm getting is the parse error on the unset command.
My thought is that it's something in the php.ini that's turned off/on or not set properly.
>>I'm not trying to unset anything.
I'm referring to the unset [php.net] statement in PHP. This is what seems to be giving you the parse error.
What version of PHP are each of the servers running? PHP 3 treated
unset as a function and as of PHP Version > 4,
unset is a statement. This may be your issue. Read my last post carefully now that you understand what I mean by
unset. Sorry for the confusion.
If possible, find the line giving the error and post it for us to take a look at. Also, the version of PHP on the server is important regarding how the statement is being used.
I've looked at the others and they're all written the same.
Well the syntax looks fine for PHP 4.3.3.
Are you sure that
unset is the actual problem? Parse errors [php.net] can be tough to find sometimes. They usually occur when you are missing a closing semicolon or brace. Can you post the exact error message you are getting?
Parse error: parse error in /home/musiccit/public_html/members/bb/includes/template.php on line 356
That's the line that I've included.
Thanks for the help to date - I really appreciate it.
Could it be a missing semicolon on the preceding line?
I don't think this has anything to do with
unset. The reason I make this statement was a quick search on google for phpbb "template.php on line 356" and you'll see what I mean.
I'm guessing that either your template.php file has been modified or changed or else the $code variable that is being passed to the
compile function within that script is the issue. If all you did was transfer the same template.php from one server to your new server, I'd double check that $code variable and how it is being processed within the
compile function step by step until you nail down what is causing the problem. There is a developer note in there stating that some funky things might happen if you have a #<!-- BEGIN (.*?) --># and an #<!-- END (.*?) --># on the same line.
I got it fixed. I had to upgrade to php v4.3.4 and that took care of it.
Thanks a ton for the input.