hiphop-php /hphp/test/zend/good/ext/standard/tests/array/compact_variation2.php

Language PHP Lines 23
MD5 Hash 2b4458beb5184681b8d95344c6f308b6 Estimated Cost $215 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?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==
Back to Top