Bug #78262 [Opn]: Wrong error line (line 0) of errors printed in __toString
| From: | e dot grinec at gmail dot com | Date: | Mon, 08 Jul 2019 06:39:22 +0000 |
| Subject: | Bug #78262 [Opn]: Wrong error line (line 0) of errors printed in __toString | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-221653@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78262&edit=1
ID: 78262
User updated by: e dot grinec at gmail dot com
Reported by: e dot grinec at gmail dot com
Summary: Wrong error line (line 0) of errors printed in
__toString
Status: Open
Type: Bug
-Package: *General Issues
+Package: Class/Object related
Operating System: Windows 10 x64
PHP Version: 7.3.7
Block user comment: N
Private report: N
New Comment:
changed Package from the "General issues" to the "Class/Object related"
Previous Comments:
------------------------------------------------------------------------
[2019-07-08 06:07:01] e dot grinec at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=78262&edit=1