--EXPECTF--
3
-Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
+Catchable fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
Bug #26166 (__toString() crash when no values returned)
--FILE--
<?php
+
class Foo
{
function __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
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===
-Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
+Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d
--FILE--
<?php
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
class Object
{
public $x;
int(3)
Overloaded::__get(y)
int(3)
-Overloaded::__set(z,Object id #3)
+string(55) "Object of class Object could not be converted to string"
+Overloaded::__set(z,)
object(Object)#%d (1) {
["x"]=>
int(4)
Overloaded::__get(z)
int(6)
===DONE===
+--UEXPECTF--
+object(Object)#%d (1) {
+ [u"x"]=>
+ int(2)
+}
+int(2)
+int(3)
+Overloaded::__set(y,3)
+int(3)
+Overloaded::__get(y)
+int(3)
+unicode(55) "Object of class Object could not be converted to string"
+Overloaded::__set(z,)
+object(Object)#%d (1) {
+ [u"x"]=>
+ int(4)
+}
+Overloaded::__get(z)
+int(4)
+Overloaded::__get(z)
+int(5)
+Overloaded::__get(z)
+int(6)
+===DONE===
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
--FILE--
<?php
-class a {
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class a
+{
public $a = 4;
function __call($a,$b) {
return "unknown method";
}
}
+
$b = new a;
echo $b,"\n";
$c = unserialize(serialize($b));
echo $c,"\n";
var_dump($c);
+
?>
--EXPECT--
-Object id #1
-Object id #2
+string(50) "Object of class a could not be converted to string"
+
+string(50) "Object of class a could not be converted to string"
+
object(a)#2 (1) {
["a"]=>
int(4)
}
+--UEXPECT--
+unicode(50) "Object of class a could not be converted to string"
+
+unicode(50) "Object of class a could not be converted to string"
+
+object(a)#2 (1) {
+ [u"a"]=>
+ int(4)
+}
function make_exception_and_change_err_reporting()
{
- error_reporting(E_ALL);
+ error_reporting(E_ALL & ~E_STRICT);
throw new Exception();
}
echo "Done\n";
?>
--EXPECTF--
-int(4095)
-int(4095)
-int(2047)
+int(8191)
+int(8191)
+int(6143)
Done
--TEST--
Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
--INI--
-error_reporting=4095
+error_reporting=8191
--FILE--
<?php
class Foo
--EXPECTF--
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
Hi!
-Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+Catchable fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+