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?

Recommended Answers

All 2 Replies

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.

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....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.