cvs: pear /Log Log.php
| From: | Jon Parise | Date: | Mon, 01 Aug 2005 06:16:50 +0000 |
| Subject: | cvs: pear /Log Log.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33489@lists.php.net to get a copy of this message | ||
jon Mon Aug 1 02:16:50 2005 EDT
Modified files:
/pear/Log Log.php
Log:
Only PHP 5 and greater support the (string) cast operation with the
special __toString() method. For older versions, call the __toString()
method directly.
http://cvs.php.net/diff.php/pear/Log/Log.php?r1=1.49&r2=1.50&ty=u
Index: pear/Log/Log.php
diff -u pear/Log/Log.php:1.49 pear/Log/Log.php:1.50
--- pear/Log/Log.php:1.49 Sun Jul 17 23:49:47 2005
+++ pear/Log/Log.php Mon Aug 1 02:16:48 2005
@@ -1,9 +1,9 @@
<?php
/**
- * $Header: /repository/pear/Log/Log.php,v 1.49 2005/07/18 03:49:47 jon Exp $
+ * $Header: /repository/pear/Log/Log.php,v 1.50 2005/08/01 06:16:48 jon Exp $
* $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $
*
- * @version $Revision: 1.49 $
+ * @version $Revision: 1.50 $
* @package Log
*/
@@ -387,7 +387,11 @@
} else if (method_exists($message, 'tostring')) {
$message = $message->toString();
} else if (method_exists($message, '__tostring')) {
- $message = (string)$message;
+ if (version_compare(PHP_VERSION, '5.0.0', 'ge')) {
+ $message = (string)$message;
+ } else {
+ $message = $message->__toString();
+ }
} else {
$message = print_r($message, true);
}