Browse Source

array copy on write tests

experimental/5.2-WITH_DRCP
Zoe Slattery 19 years ago
parent
commit
5d0ee5b518
  1. 17
      Zend/tests/array_append_COW.phpt
  2. 17
      Zend/tests/array_unshift_COW.phpt

17
Zend/tests/array_append_COW.phpt

@ -0,0 +1,17 @@
--TEST--
Tests that array manipulation code is correctly dealing with copy on write and
splitting on reference.
--FILE--
<?php
$a=array();
$b=1;
$c=&$b;
$a[]=$b;
$b=2;
var_dump ($a);
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}

17
Zend/tests/array_unshift_COW.phpt

@ -0,0 +1,17 @@
--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)
}
Loading…
Cancel
Save