|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-12-09 06:37 UTC] andi@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 04:00:02 2025 UTC |
$globalref_bar===NULL after $o2 = &new Bar(); 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) { } -----------------------------