Forum Moderators: coopster
Note that in PHP 3, unset() will always return(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.TRUE
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.For example:
@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 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 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.
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?
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.