2010/8/4 Shijiang <shiji...@staff.sina.com.cn> > I was working with PHP 5.2.9 with error_report=E_ALL and display_errors=On > and got no error at all. > > Just now I tried it under PHP 5.3.0 and got the warning. > > Sometimes although I declared the magic method __call(), I want to prevent > it from being called outside the class. > Could someone be kindly enough to tell me why it must be public? > > Thanks. > > Hi,
To get the error messages mentioned above, you might want to try the following error reporting level: E_ALL | E_STRICT Please refer to the manual to understand why E_ALL does not actually mean all error levels: http://www.php.net/manual/en/function.error-reporting.php (below "Notes") Also, your php.ini file for PHP 5.3 has details explaining why this version includes E_STRICT (I am guessing you chose the "development" version). As for your other question regarding why the magic method visibility works as it does, the answer has been given in the following bug reports: http://bugs.php.net/bug.php?id=40056 http://bugs.php.net/bug.php?id=44769 Regards, -- Guillaume Rossolini