php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49734 toString must return string value
Submitted: 2009-10-01 12:35 UTC Modified: 2009-11-12 23:18 UTC
From: jaaspden at uk dot ibm dot com Assigned: felipe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 6SVN-2009-10-01 (snap) OS: Windows and Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jaaspden at uk dot ibm dot com
New email:
PHP Version: OS:

 

 [2009-10-01 12:35 UTC] jaaspden at uk dot ibm dot com
Description:
------------
When using ReflectionException _toString requires a string value to be returned. Earlier versions will accept integers and arrays

Reproduce code:
---------------
<?php
$e = new Exception("message");
$exc = new ReflectionException($e);
var_dump($exc->getCode());
?>

Expected result:
----------------
int(%d)

Actual result:
--------------
Catchable fatal error: Method Exception::__toString() must return a string value in %s on line %d

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-12 23:18 UTC] svn@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=290642
Log: - Fixed bug #49734 (toString must return string value)
 [2009-11-12 23:18 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 15:01:33 2025 UTC