I've got to move a web site (custom-written (not by me), so just updating a CMS is not an option) to a PHP 5.3 server. The code complains::
Fatal error: Method cDate::__tostring() cannot take arguments in ...\lib.datetime.php on line 183
I've googled to find out that the problem is because "with PHP 5.3 the magic method __tostring() no more accepts any parameter", "... implements its __tostring() by accepting parameter ... which is now deprecated in favor of the new __tostring() for PHP 5.3". Here's the code:
public function __toString($format = 'Y-m-d')
{
// the next is the line #182, the line #183 mentioned in the error message is the closing brace
return date($format, $this->_stamp);
}
Is there something like a php.ini parameter I can tweak to bring this back to work?
I am not a PHP developer, neither I am too much willing to dive into studying and modifying the code which was written by some web dev outsourcing company in the past of the company I work for. My task is to move the web site from a shared hosting provider to a dedicated server which I admin (I run Ubuntu 10.04 LTS Server there) and which I'd strongly prefer not to downgrade to PHP 5.2. It would be great If I could just make it work with some configuration magic. I am afraid that if I modify a method, then the entire thing is going to stop working as expected.