summaryrefslogtreecommitdiff
path: root/Zend/tests/magic_by_ref_001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/magic_by_ref_001.phpt')
-rw-r--r--Zend/tests/magic_by_ref_001.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/magic_by_ref_001.phpt b/Zend/tests/magic_by_ref_001.phpt
new file mode 100644
index 000000000..e9bcf8fa2
--- /dev/null
+++ b/Zend/tests/magic_by_ref_001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+passing first parameter of __set() by ref
+--FILE--
+<?php
+
+class test {
+ function __set(&$name, $val) { }
+}
+
+$t = new test;
+$name = "prop";
+$t->$name = 1;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Method test::__set() cannot take arguments by reference in %s on line %d