hiphop-php /hphp/test/slow/array_functions/self_recursive.php

Language PHP Lines 22
MD5 Hash f15f79837b7dcb56961206fa8ee6ca6a Estimated Cost $306 (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
<?php

function test($g) {
  $GLOBALS['g'] = $GLOBALS;

  array_replace_recursive($GLOBALS, $g);

  $GLOBALS['g'] = $GLOBALS;
  array_merge_recursive($GLOBALS, $g);
}

function main() {
  $a = array();
  $a['g'] = &$a;

  test($a);
  test($GLOBALS);
  var_dump(compact($a));
}

main();
Back to Top