summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/tests/strings/bug42208.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/bug42208.phpt b/ext/standard/tests/strings/bug42208.phpt
new file mode 100644
index 0000000000..f672c8a66c
--- /dev/null
+++ b/ext/standard/tests/strings/bug42208.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #42208 (substr_replace() crashes when the same array is passed more than once)
+--FILE--
+<?php
+$a = array(1, 2);
+$c = $a;
+var_dump(substr_replace($a, 1, 1, $c));
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(2) "11"
+ [1]=>
+ string(2) "21"
+}
+--UEXPECT--
+array(2) {
+ [0]=>
+ unicode(2) "11"
+ [1]=>
+ unicode(2) "21"
+}