summaryrefslogtreecommitdiff
path: root/Zend/tests/bug72598.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug72598.phpt')
-rw-r--r--Zend/tests/bug72598.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/Zend/tests/bug72598.phpt b/Zend/tests/bug72598.phpt
new file mode 100644
index 0000000000..dfb09a05b8
--- /dev/null
+++ b/Zend/tests/bug72598.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #72598 (Reference is lost after array_slice())
+--FILE--
+<?php
+function ref(&$ref) {
+ var_dump($ref);
+}
+
+new class {
+ function __construct() {
+ $args = [&$this];
+ for ($i = 0; $i < 2; $i++) {
+ $a = array_slice($args, 0, 1);
+ call_user_func_array('ref', $a);
+ }
+ }
+};
+?>
+--EXPECTF--
+Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
+object(class@anonymous)#1 (0) {
+}
+
+Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
+object(class@anonymous)#1 (0) {
+}