php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45387 (string)$obj on objects w/o __toString() behaves differently
Submitted: 2008-06-28 17:42 UTC Modified: 2009-02-19 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tswicegood@php.net Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.3CVS-2008-06-28 (CVS) OS: OS X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
47 - 38 = ?
Subscribe to this entry?

 
 [2008-06-28 17:42 UTC] tswicegood@php.net
Description:
------------
In PHP 5.2.x calling (string)$object on an object w/o the __toString() 
method would cause a catchable fatal error and would halt execution.  In 
PHP 5.3, the error is thrown but execution continues.

This is the same behavior as PHP 5.1.4 - 5.1.6 (may be true for older 
versions as well, but I only tested back to 5.1.4).

Reproduce code:
---------------
<?php

$o = new StdClass();
@(string)$o;
echo "OK";

Expected result:
----------------
Unsure - possibly OK, possibly nothing.  I'm not sure if 5.2.x or 
5.1/5.3 behavior is correct.

Actual result:
--------------
OK

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-02 02:21 UTC] felipe@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.3-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.3-win32-installer-latest.msi

I can't reproduce.
 [2008-07-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-02-11 21:35 UTC] felipe@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-02-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC