diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
| commit | fd5a0b31640419ca63d1ddeaffd6d3cf2a741814 (patch) | |
| tree | bfd17d84c5181d7b98d7d66f56573f4fc897e31c /ext/standard/tests/array | |
| parent | 01fcdff3849c3691d9aaeaab735846ab6d8895ca (diff) | |
| download | php-upstream/5.3.5.tar.gz | |
Imported Upstream version 5.3.5upstream/5.3.5
Diffstat (limited to 'ext/standard/tests/array')
| -rw-r--r-- | ext/standard/tests/array/bug52534.phpt | 14 | ||||
| -rw-r--r-- | ext/standard/tests/array/extract_safety.phpt | 24 |
2 files changed, 38 insertions, 0 deletions
diff --git a/ext/standard/tests/array/bug52534.phpt b/ext/standard/tests/array/bug52534.phpt new file mode 100644 index 000000000..dfff3fdb4 --- /dev/null +++ b/ext/standard/tests/array/bug52534.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #52534 (var_export array with negative key) +--FILE-- +<?php + +$aArray = array ( -1 => 'Hello'); + +var_export($aArray); + +?> +--EXPECT-- +array ( + -1 => 'Hello', +) diff --git a/ext/standard/tests/array/extract_safety.phpt b/ext/standard/tests/array/extract_safety.phpt new file mode 100644 index 000000000..d5d0763be --- /dev/null +++ b/ext/standard/tests/array/extract_safety.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test extract() for overwrite of GLOBALS +--FILE-- +<?php +$str = "John"; +debug_zval_dump($GLOBALS["str"]); + +/* Extracting Global Variables */ +$splat = array("foo" => "bar"); +var_dump(extract(array("GLOBALS" => $splat, EXTR_OVERWRITE))); + +unset ($splat); + +debug_zval_dump($GLOBALS["str"]); + +echo "\nDone"; +?> + +--EXPECTF-- +string(4) "John" refcount(2) +int(0) +string(4) "John" refcount(2) + +Done
\ No newline at end of file |
