PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 39ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/array/compact_variation1.php

http://github.com/facebook/hiphop-php
PHP | 24 lines | 16 code | 0 blank | 8 comment | 0 complexity | b58c28e5455d48f5ab9d448aaf64451d 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*/
 7/*
 8* compact variations - arrays with references
 9*/
10echo "*** Testing compact() : usage variations  - arrays containg references ***\n";
11$a = 1;
12$b = 2;
13$c = 3;
14$string = "c";
15$arr1 = array("a", &$arr1);
16$arr2 = array("a", array(array(array("b"))));
17$arr2[1][0][0][] = &$arr2;
18$arr2[1][0][0][] = &$arr2[1];
19$arr3 = array(&$string);
20var_dump(compact($arr1));
21var_dump(compact($arr2));
22var_dump(compact($arr3));
23echo "Done";
24?>