/hphp/test/zend/good/ext/standard/tests/array/compact_variation2.php
http://github.com/facebook/hiphop-php · PHP · 22 lines · 13 code · 4 blank · 5 comment · 0 complexity · 2b4458beb5184681b8d95344c6f308b6 MD5 · raw file
- <?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==