Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4764
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | k@rl.pflaesterer.de (Karl Pflästerer) |
| Newsgroups | de.comp.lang.php |
| Subject | Re: ::class und constant() |
| Date | Tue, 11 Jan 2022 16:40:36 +0100 |
| Lines | 20 |
| Message-ID | <m1r19ei8ln.fsf@mbp.pflaesterer.de> (permalink) |
| References | <1t61dbfeaei1306d1n3e8%sfroehli@Froehlich.Priv.at> <j455o0F9s0bU1@mid.individual.net> <1t61dd7d76i17c110n3e8%sfroehli@Froehlich.Priv.at> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net kbIA9kBqMq6JZenzAFUM3gv+ekcMHoJ/aaLVu8Sjb8rTBmREY= |
| Cancel-Lock | sha1:FPWcyYp/qLVJEfY6u8S4fVV4clc= sha1:Zzk4hh4O6Wujpvxwuv4tESN5mH0= |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) |
| Xref | csiph.com de.comp.lang.php:4764 |
Show key headers only | View raw
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