My mp3 player .php file worked fine years ago, but when I recently tried to use it again, it no longer works with PHP v.7.
I've run code through phptester.net and fixed first issue by changing $new to new, but now tester flags the following as unexpected (T_STRING) -

if ($this->mode & PEAR_ERROR_EXCEPTION) {
trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
eval('$e = new Exception($this->message, $this->code);throw($e);');
}
I've changed PEAR_ERROR_EXCEPTION to PEAR_Exception but phptester.net still flags the same line of code/
What must I change in code for it to be current and not obsolete?


    if ($this->mode & PEAR_ERROR_EXCEPTION) {
    trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
    eval('$e = new Exception($this->message, $this->code);throw($e);');
    }

    Looks reasonable to me; there is no bogus string there. Possibly there's an earlier line where a string was started but not finished.
    What I don't get is why

    eval('$e = new Exception($this->message, $this->code);throw($e);');

    isn't just written as

    throw new Exception($this->message, $this->code);
      9 months later
      Write a Reply...