]> granicus.if.org Git - php/commitdiff
- Fix test
authorMarcus Boerger <helly@php.net>
Thu, 6 Oct 2005 18:52:51 +0000 (18:52 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 6 Oct 2005 18:52:51 +0000 (18:52 +0000)
- Convert to unicode

Zend/tests/bug26166.phpt

index e2800ad8789df515ac14499143b74d8618b34906..e48a21afbb588034a5a354b4b0c0cadbf58294c5 100755 (executable)
@@ -2,6 +2,7 @@
 Bug #26166 (__toString() crash when no values returned)
 --FILE--
 <?php
+
 class Foo
 {
     function __toString()
@@ -28,6 +29,23 @@ class Bar
 $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 
@@ -45,23 +63,12 @@ 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===
+string(52) "Method None::__toString() must return a string value"
+===THROW===
 
-Catchable fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
+Fatal error: Object of class Error could not be converted to string in %sbug26166.php on line %d