From: lapo at lapo dot it
Operating system: Win32
PHP version: 5.0.0RC2
PHP Bug Type: Zend Engine 2 problem
Bug description: using an object as a string parameter converts it to a string
Description:
------------
Tidy-PHP binding documentation is not very clear (yep, I will RTFS
someday) but in each example uses the output $tidy object directly in an
"echo" just to output it's value, using (I guess) it's internal
__toString() method.
As far as I do "echo" it, no problem, but passing it to a string-accepting
function actually converts it to a string instead of just using the output
of its toString method.
Reproduce code:
---------------
$tidy = tidy_parse_string('<b>Just a try', array(), 'UTF8');
$a = htmlspecialchars($tidy . '');
echo gettype($tidy) . ', ';
$a = htmlspecialchars($tidy);
echo gettype($tidy);
Expected result:
----------------
Output: object, object
Actual result:
--------------
Output: object, string
--
Edit bug report at http://bugs.php.net/?id=28591&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28591&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28591&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28591&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28591&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28591&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28591&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28591&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28591&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28591&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28591&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28591&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28591&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28591&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28591&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28591&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28591&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28591&r=float