Bug #78262 [NEW]: Wrong error line (line 0) of errors printed in __toString

From: Date: Mon, 08 Jul 2019 06:07:01 +0000
Subject: Bug #78262 [NEW]: Wrong error line (line 0) of errors printed in __toString
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221652@lists.php.net to get a copy of this message
From: e dot grinec at gmail dot com Operating system: Windows 10 x64 PHP version: 7.3.7 Package: *General Issues Bug Type: Bug Bug description:Wrong error line (line 0) of errors printed in __toString Description: ------------ PHP Version 7.3.2 <?php class Test { public function __toString() { return NotExistsClass::notExistsMethod(); // make here any type of error } } print new Test(); // Fatal error: Method Test::__toString() must not throw an exception, caught Error: Class 'NotExistsClass' not found in D:\Portable\OSPanel\domains\test.test\test.php on line 0 Test script: --------------- <?php class Test { public function __toString() { return NotExistsClass::notExistsMethod(); // make here any type of error } } print new Test(); Expected result: ---------------- Fatal error: Method Test::__toString() must not throw an exception, caught Error: Class 'NotExistsClass' not found in D:\Portable\OSPanel\domains\test.test\test.php on line 6 Actual result: -------------- Fatal error: Method Test::__toString() must not throw an exception, caught Error: Class 'NotExistsClass' not found in D:\Portable\OSPanel\domains\test.test\test.php on line 0 -- Edit bug report at https://bugs.php.net/bug.php?id=78262&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78262&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78262&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78262&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78262&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78262&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78262&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78262&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78262&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78262&r=support Expected behavior: https://bugs.php.net/fix.php?id=78262&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78262&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78262&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78262&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78262&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78262&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78262&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78262&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78262&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78262&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78262&r=mysqlcfg

« previous php.bugs (#221652) next »