Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #5802

const var, self:: or static::

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Simon <bad@example.com>
Newsgroups comp.lang.php
Subject const var, self:: or static::
Date Wed, 02 May 2012 11:45:12 +0200
Lines 20
Message-ID <a0ce19Fb48U1@mid.individual.net> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net PFGqvpd5jm5oc6ft1r1dugigKnTQ+gjZMIXsO0j5wot7bqTEfK7X8Qzh14NySQKuVO
Cancel-Lock sha1:6nBgQ3Eokd2VWcJDenkCXS1JJ88=
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
Xref csiph.com comp.lang.php:5802

Show key headers only | View raw


If I have something like...

//
class MyClass
{
  const MY_CONST =  10;

  ...
}
//

Inside the class, is it 'better' to use self::MY_CONST or static::MY_CONST?

I say 'better' because it works in both cases.

Or is it just a personal choice.

Thanks

Simon

Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

const var, self:: or static:: Simon <bad@example.com> - 2012-05-02 11:45 +0200
  Re: const var, self:: or static:: Jerry Stuckle <jstucklex@attglobal.net> - 2012-05-02 07:13 -0400
  Re: const var, self:: or static:: "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-05-02 17:25 +0200
    Re: const var, self:: or static:: Michael Fesser <netizen@gmx.de> - 2012-05-02 19:55 +0200

csiph-web