Note Submitter: seanhickey at gmail dot com
----
Note that class objects will not be in the $GLOBALS array until *after* the classe's constructor returns.
<?php
class A
{
public function __construct()
{
var_dump($GLOBALS);
}
}
$a = new A;
var_dump($GLOBALS);
?>
The first var_dump() inside the __construct() method will not contain the value of $a, while the second one will.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.