Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4764
| From | k@rl.pflaesterer.de (Karl Pflästerer) |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | Re: ::class und constant() |
| Date | 2022-01-11 16:40 +0100 |
| Message-ID | <m1r19ei8ln.fsf@mbp.pflaesterer.de> (permalink) |
| References | <1t61dbfeaei1306d1n3e8%sfroehli@Froehlich.Priv.at> <j455o0F9s0bU1@mid.individual.net> <1t61dd7d76i17c110n3e8%sfroehli@Froehlich.Priv.at> |
Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) writes: > > ...und genau da war meine Fehlannahme. Bei __LINE__ wäre ich gar > nicht erst auf die Idee gekommen, da das ja ganz offensichtlich > keine Konstante, sondern nur Magie sein kann. Auf der von Dir > verlinkten URL habe ich halt nicht gesucht, sondern auf: > <https://www.php.net/manual/en/function.constant.php>, und dort wird > man dann weiterverwiesen auf > <https://www.php.net/manual/en/language.oop5.constants.php>, wo > wiederum nach dem ersten Beispiel ::class erwähnt wird. > > Aber ok, dann ist das halt so, wiewohl ärgerlich. Wofür müsstest du denn Cls::class als Zeichenkette nutzen können Ich nutze ::class genau um keine Klassennamen (inklusive namespace) als String schreiben zu müssen (und weil die IDE dann die Klasse als verwendet findet; ist praktisch wenn man Cls::class als Key in einem Service Container nutzt)
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
::class und constant() Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-01-10 09:46 +0000
Re: ::class und constant() k@rl.pflaesterer.de (Karl Pflästerer) - 2022-01-10 22:29 +0100
Re: ::class und constant() Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-01-10 23:12 +0000
Re: ::class und constant() Arno Welzel <usenet@arnowelzel.de> - 2022-01-11 11:50 +0100
Re: ::class und constant() Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-01-11 13:41 +0000
Re: ::class und constant() k@rl.pflaesterer.de (Karl Pflästerer) - 2022-01-11 16:40 +0100
Re: ::class und constant() Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2022-01-11 17:36 +0000
csiph-web