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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 23:01:29 2024 UTC