summaryrefslogtreecommitdiff
path: root/Zend/tests/array_unshift_COW.phpt
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2007-07-09 13:18:03 +0000
committerZoe Slattery <zoe@php.net>2007-07-09 13:18:03 +0000
commit3cf3ad9c03eac2d55d9b413a37b492f1b66c9480 (patch)
tree9d3933cc64af9cad874a8add4cccd4249d97ff7d /Zend/tests/array_unshift_COW.phpt
parent6873ee88670123264a051ae44e775f3c3182d005 (diff)
downloadphp-git-3cf3ad9c03eac2d55d9b413a37b492f1b66c9480.tar.gz
array copy on write tests
Diffstat (limited to 'Zend/tests/array_unshift_COW.phpt')
-rw-r--r--Zend/tests/array_unshift_COW.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/array_unshift_COW.phpt b/Zend/tests/array_unshift_COW.phpt
new file mode 100644
index 0000000000..864fc29e33
--- /dev/null
+++ b/Zend/tests/array_unshift_COW.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ Tests that array unshift code is correctly dealing with copy on write and
+ splitting on reference.
+--FILE--
+<?php
+ $a=array();
+ $b=1;
+ $c=&$b;
+ array_unshift ($a,$b);
+ $b=2;
+ var_dump ($a);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ int(1)
+}
+--EXPECT--
+array(1) {
+ [0]=>
+ int(1)
+} \ No newline at end of file