Disallow declarations outside of the global scope.
[hiphop-php.git] / hphp / test / slow / inout / tuple / tests / def-func.php
blobfc4dc5741955aad7bf4e5305326139535b06a3b0
1 <?hh
3 function main($nontop) {
4 function nontop(inout $x, inout $y) {
5 list($x, $y) = array($y, $x);
6 $bt = array_slice(debug_backtrace(), 0, 2);
7 echo implode(', ',array_map($a ==> $a['function'], $bt))."\n";
8 return 'foo';
11 $x1 = 24;
12 $y1 = 42;
13 $a = nontop(inout $x1, inout $y1);
14 var_dump($a, $x1, $y1);
16 $x2 = 18;
17 $y2 = 81;
18 $a = $nontop(inout $x2, inout $y2);
19 var_dump($a, $x2, $y2);
22 main('nontop');