php-developer-list | 2002112
Date: 11/26/02
- Next message: Jan Maska: "[PHP-DEV] Re: #20638 [Opn->Fbk]: Apache cannot start"
- Previous message: Pierre-Alain Joye: "Re: [PHP-DEV] [PATCH] Redirect on Error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello php-dev,
PHP4.3.0RC1
Source
----------------------------
<?
$globalref_foo = array();
$globalref_bar = null;
class Foo {
function Foo()
{
global $globalref_foo;
$globalref_foo[] = &$this;
}
}
class Bar {
function Bar()
{
global $globalref_bar;
$globalref_bar = &$this;
}
}
$o1 = &new Foo();
$o2 = &new Bar();
var_dump($globalref_foo);
var_dump($globalref_bar);
var_dump($o1);
var_dump($o2);
?>
Output:
----------------------------
array(1) {
[0]=>
&object(foo)(0) {
}
}
NULL
object(foo)(0) {
}
object(bar)(0) {
}
Question:
----------------------------
Why $globalref_bar===NULL after $o2 = &new Bar(); ?
Why
Best regards,
Andrew Sitnikov
e-mail : sitnikov <email protected>
GSM: (+372) 56491109
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Jan Maska: "[PHP-DEV] Re: #20638 [Opn->Fbk]: Apache cannot start"
- Previous message: Pierre-Alain Joye: "Re: [PHP-DEV] [PATCH] Redirect on Error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

