summaryrefslogtreecommitdiff
path: root/Zend/tests/debug_info-error-resource.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/debug_info-error-resource.phpt')
-rw-r--r--Zend/tests/debug_info-error-resource.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Zend/tests/debug_info-error-resource.phpt b/Zend/tests/debug_info-error-resource.phpt
new file mode 100644
index 0000000000..c6d7be4cd9
--- /dev/null
+++ b/Zend/tests/debug_info-error-resource.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns RESOURCE
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(fopen("data:text/plain,Foo", 'r'));
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s/Zend/tests/debug_info-error-resource.php on line %d