Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48331 invoked by uid 1010); 25 Apr 2006 13:02:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 48315 invoked from network); 25 Apr 2006 13:02:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2006 13:02:41 -0000 X-PHP-List-Original-Sender: bu@orbitel.bg X-Host-Fingerprint: 195.24.32.29 vmail-1.orbitel.bg Linux 2.4/2.6 Received: from ([195.24.32.29:33311] helo=vmail-1.orbitel.bg) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6C/F2-19715-0FD1E444 for ; Tue, 25 Apr 2006 09:02:41 -0400 Received: from localhost (mailprotection [10.0.0.2]) by vmail-1.orbitel.bg (Postfix) with ESMTP id E9E1F11E33 for ; Tue, 25 Apr 2006 16:02:36 +0300 (EEST) Received: from vmail-1.orbitel.bg ([10.0.0.1]) by localhost (sof-rv1.orbitel.bg [10.0.0.2]) (amavisd-new, port 10024) with ESMTP id 11552-32 for ; Tue, 25 Apr 2006 15:56:50 +0300 (EEST) Received: from [192.168.0.207] (unknown [87.126.31.26]) by vmail-1.orbitel.bg (Postfix) with ESMTP id 85607E109 for ; Tue, 25 Apr 2006 16:02:32 +0300 (EEST) Reply-To: bu@orbitel.bg To: internals@lists.php.net Date: Tue, 25 Apr 2006 16:02:39 +0300 User-Agent: KMail/1.9.1 References: <444E0854.2000804@emini.dk> In-Reply-To: <444E0854.2000804@emini.dk> X-Face: "c4tG*FY$8"*gUsm0B.S%v5*[!@-f4J`V@OaocG0\)x]-G`$Hy1#tWj~4VvL@6s X-Virus-Scanned: by amavisd-new at orbitel.bg Subject: Re: [PHP-DEV] Static properties From: bu@orbitel.bg (Petar Nedyalkov) --nextPart12325988.ecPQYi9ADH Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 25 April 2006 14:30, Edin Kadribasic wrote: > Hi, > > I was wondering if someone could enlighten me why it is not possible to > create on-the-fly static properties: > > php -r 'class foo{}; foo::$bar =3D 1;' > Fatal error: Access to undeclared static property: foo::$bar in Command > line code on line 1 This totally breaks the capsulation in the OO paradigm, so I find it the ri= ght=20 behaviour. Taking apart the fact that there's no compilation in PHP, it als= o=20 prevents capsulation and making a member variable of an object available on= ly=20 after it's declaration in the class (except for stdClass) is correct for me= =2E=20 I see this as "You can't redefine the model at runtime". > > Was this not possible because of the engine implementation of the static > properties? > > Edin =2D-=20 Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 --nextPart12325988.ecPQYi9ADH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBETh3yLT98C3rkVDYRAsDsAJwKsYHg3BsFsKmskvQirAXLEpTY9gCfSSKt J9LEHKnUAjDCynhi7FyKZpI= =n6vE -----END PGP SIGNATURE----- --nextPart12325988.ecPQYi9ADH--