Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 /tests bug26166.phpt

From: Date: Thu, 06 Oct 2005 18:54:25 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 /tests bug26166.phpt
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4205@lists.php.net to get a copy of this message
Hello internals, that should read 'unix' not 'uncode', tooooo much unicode changes going on :-) Thursday, October 6, 2005, 8:52:53 PM, you wrote: > helly Thu Oct 6 14:52:53 2005 EDT > Modified files: > /ZendEngine2/tests bug26166.phpt > Log: > - Fix test > - Convert to unicode > > > > http://cvs.php.net/diff.php/ZendEngine2/tests/bug26166.phpt?r1=1.3&r2=1.4&ty=u > Index: ZendEngine2/tests/bug26166.phpt > diff -u ZendEngine2/tests/bug26166.phpt:1.3 ZendEngine2/tests/bug26166.phpt:1.4 > --- ZendEngine2/tests/bug26166.phpt:1.3 Tue Sep 27 03:59:01 2005 > +++ ZendEngine2/tests/bug26166.phpt Thu Oct 6 14:52:51 2005 > @@ -1,67 +1,74 @@ > ---TEST-- > -Bug #26166 (__toString() crash when no values returned) > ---FILE-- > -<?php > -class Foo > -{ > - function __toString() > - { > - return "Hello World!\n"; > - } > -} > - > -class Bar > -{ > - private $obj; > - > - function __construct() > - { > - $this->obj = new Foo(); > - } > - > - function __toString() > - { > - return $this->obj->__toString(); > - } > -} > - > -$o = new Bar; > -echo $o; > - > -echo "===THROW===\n"; > - > -class Error > -{ > - function __toString() { > - throw new Exception("This is an error!"); > - } > -} > - > -$o = new Error; > -try { > - echo $o; > -} > -catch (Exception $e) { > - echo "Got the exception\n"; > -} > - > -echo "===NONE===\n"; > - > -class None > -{ > - function __toString() { > - } > -} > - > -$o = new None; > -echo $o; > - -?>> > -===DONE=== > ---EXPECTF-- > -Hello World! > -===THROW=== > -Got the exception > -===NONE=== > - > -Catchable fatal error: Method None::__toString() must return a string value in %sbug26166.php > on line %d > +--TEST-- > +Bug #26166 (__toString() crash when no values returned) > +--FILE-- > +<?php > + > +class Foo > +{ > + function __toString() > + { > + return "Hello World!\n"; > + } > +} > + > +class Bar > +{ > + private $obj; > + > + function __construct() > + { > + $this->obj = new Foo(); > + } > + > + function __toString() > + { > + return $this->obj->__toString(); > + } > +} > + > +$o = new Bar; > +echo $o; > + > +echo "===NONE===\n"; > + > +function my_error_handler($errno, $errstr, $errfile, $errline) { > + var_dump($errstr); > +} > + > +set_error_handler('my_error_handler'); > + > +class None > +{ > + function __toString() { > + } > +} > + > +$o = new None; > +echo $o; > + > +echo "===THROW===\n"; > + > +class Error > +{ > + function __toString() { > + throw new Exception("This is an error!"); > + } > +} > + > +$o = new Error; > +try { > + echo $o; > +} > +catch (Exception $e) { > + echo "Got the exception\n"; > +} > + +?>> > +===DONE=== > +--EXPECTF-- > +Hello World! > +===NONE=== > +string(52) "Method None::__toString() must return a string value" > +===THROW=== > + > +Fatal error: Object of class Error could not be converted to string in %sbug26166.php on line > %d Best regards, Marcus

« previous php.zend-engine.cvs (#4205) next »