bug30791.phpt 613 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded)
  3. --FILE--
  4. <?php
  5. function my_error_handler($errno, $errstr, $errfile, $errline) {
  6. var_dump($errstr);
  7. }
  8. set_error_handler('my_error_handler');
  9. class a
  10. {
  11. public $a = 4;
  12. function __call($a,$b) {
  13. return "unknown method";
  14. }
  15. }
  16. $b = new a;
  17. echo $b,"\n";
  18. $c = unserialize(serialize($b));
  19. echo $c,"\n";
  20. var_dump($c);
  21. ?>
  22. --EXPECT--
  23. string(50) "Object of class a could not be converted to string"
  24. string(50) "Object of class a could not be converted to string"
  25. object(a)#2 (1) {
  26. ["a"]=>
  27. int(4)
  28. }