PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 2ms RepoModel.GetById 39ms app.codeStats 0ms

/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
 1<?php
 2/* Prototype  : proto array compact(mixed var_names [, mixed ...])
 3* Description: Creates a hash containing variables and their values
 4* Source code: ext/standard/array.c
 5* Alias to functions:
 6*/
 7echo "*** Testing compact() : usage variations  - variables outside of current scope ***\n";
 8
 9$a = 'main.a';
10$b = 'main.b';
11
12function f() {
13	$b = 'f.b';
14	$c = 'f.c';
15	var_dump(compact('a','b','c'));
16	var_dump(compact(array('a','b','c')));
17}
18
19f();
20
21?>
22==Done==