From: Operating system: Irrelevant PHP version: 5.2.14 Package: Strings related Bug Type: Bug Bug description:htmlentities and htmlspecialchars problems with __toString
Description: ------------ When passing an instance of a class implementing __toString, as the first argument to htmlentities or htmlspecialchars, the object is apparently not always (maybe never?) cast to string before being pushed on the stack. In some cases this will cause php to erronously output that the function requires parameter 2 to be long, unknown given. This seems to be an error from the underlying C function? Sadly, I cannot provide a test script to reproduce the behaviour, but it should be easy enough to check whether my theory is correct. -- Edit bug report at http://bugs.php.net/bug.php?id=53109&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53109&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53109&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53109&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53109&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53109&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53109&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53109&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53109&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53109&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53109&r=support Expected behavior: http://bugs.php.net/fix.php?id=53109&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53109&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53109&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53109&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53109&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53109&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53109&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53109&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53109&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53109&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53109&r=mysqlcfg