954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Strange unset() problem

Hi,
I have a class and i have unset() within a function in it which throws Parse error unexpected T_UNSET.

Some code :

class foo
{
      function abc()
     {
          unset($this->err['main']['sub']['TOBEDELETED']);
      }
}


Where I want to unset only key TOBEDELETED .
What may cause this?

fenixZ
Light Poster
25 posts since Feb 2008
Reputation Points: 10
Solved Threads: 6
 

Is this exactly the code that gives you the error ? I'm asking because you would normally get that error if you try to assign the unset to a variable.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 
Is this exactly the code that gives you the error ? I'm asking because you would normally get that error if you try to assign the unset to a variable.

Well not exactly the same, my class is much bigger, but the structure and line where unset is used is almost the same. I really do not understand why this is happening and now a workaround must be found....

fenixZ
Light Poster
25 posts since Feb 2008
Reputation Points: 10
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: