PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PEAR » PEAR » Bug #10008

__toString() missing!

Details

Request #10008__toString() missing!
Submitted2007-02-02 10:06 UTC
Fromajurak at graz4u dot at
StatusWont fix
PackagePEAR
PHP Version5.2.0
OSsuse linux 10.2
Roadmaps(Not assigned)

Comments

[2007-02-02 10:06 UTC] ajurak at graz4u dot at

Description:
------------
in the PEAR class: __toString() function is missing!
in "all" other classes:
a) add "extends PEAR" to eg: PEAR_Error
or
b) add __toString()

Test script:
---------------
<?php

echo "<br>-----------------<br>\n";

ini_set('include_path',ini_get('include_path').':/usr/share/php5/PEAR/:');
ini_set('display_errors', "On");
echo "PHP Version: " . phpversion();

require_once("PEAR.php");
$test =& new PEAR();

echo "<br><br>\n";
echo "test: $test\n";
echo "<br>\n";

echo "<br>-----------------<br>\n";

?>

------------

fix maybe like (not very beautiful though):

// FIXXXXME: ajurak!
function __toString()
{
if (method_exists($this, 'toString'))
return $this->toString();
else
return "";
}

Expected result:
----------------
-----------------
PHP Version: 5.2

test: Object id #1

-----------------

Actual result:
--------------
(already fixxed, can not reproduce anymore -> production system! sorry.)