$_GET by reference
Posted: Thu Apr 22, 2010 2:32 pm
What am I missing here? I would have thought this would work fine:
Outputs:
Code: Select all
<?php
$_GET = array('foo' => 'foo', 'bar' => 'bar');
class referenceTest {
private $get = array();
public function __construct() {
$this->get &= $_GET;
unset($this->get['foo']);
}
}
$n = new referenceTest();
echo '<pre>' . print_r($_GET, true) . '</pre>';Array
(
[foo] => foo
[bar] => bar
)