|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-09 14:10 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 05:00:01 2025 UTC |
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