/hphp/test/zend/good/ext/standard/tests/array/compact_variation2.php
PHP | 22 lines | 13 code | 4 blank | 5 comment | 0 complexity | 2b4458beb5184681b8d95344c6f308b6 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- /* Prototype : proto array compact(mixed var_names [, mixed ...])
- * Description: Creates a hash containing variables and their values
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
- echo "*** Testing compact() : usage variations - variables outside of current scope ***\n";
- $a = 'main.a';
- $b = 'main.b';
- function f() {
- $b = 'f.b';
- $c = 'f.c';
- var_dump(compact('a','b','c'));
- var_dump(compact(array('a','b','c')));
- }
- f();
- ?>
- ==Done==