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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tswicegood@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Fri Oct 11 18:01:28 2024 UTC