summaryrefslogtreecommitdiff
path: root/Zend/tests/debug_info-error-0.0.phpt
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2014-02-20 11:55:27 -0800
committerSara Golemon <pollita@php.net>2014-02-20 12:10:00 -0800
commit14c08ea362e5f16527b3d9772ddc75ca49cc22d7 (patch)
tree230f74999ea86030cd84d31e9561bc0bd9d1a192 /Zend/tests/debug_info-error-0.0.phpt
parentb67c8b8603f7fa3914f51deefa5a265315179d80 (diff)
downloadphp-git-14c08ea362e5f16527b3d9772ddc75ca49cc22d7.tar.gz
Add more tests for __debugInfo() and fix leak
Diffstat (limited to 'Zend/tests/debug_info-error-0.0.phpt')
-rw-r--r--Zend/tests/debug_info-error-0.0.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Zend/tests/debug_info-error-0.0.phpt b/Zend/tests/debug_info-error-0.0.phpt
new file mode 100644
index 0000000000..67cbe8a749
--- /dev/null
+++ b/Zend/tests/debug_info-error-0.0.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns ZERO (float)
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(0.0);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s/Zend/tests/debug_info-error-0.0.php on line %d