Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #3606
| Path | csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | de.comp.lang.php |
| Subject | Re: Designfrage |
| Date | Sat, 12 Dec 2015 20:25:30 +0100 |
| Organization | PointedEars Software (PES) |
| Lines | 31 |
| Message-ID | <2133478.Oj6hRU3P9d@PointedEars.de> (permalink) |
| References | <1t55f16c9di4689n3e8%sfroehli@Froehlich.Priv.at> <murnm1$qlc$1@dont-email.me> <2915507.bUqziVz7J1@PointedEars.de> <n4hoa5$ivc$1@solani.org> |
| Reply-To | Thomas 'PointedEars' Lahn <usenet@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1449948330 1974 eJwFwYERgDAIA8CVipAEx+lJ2H8E/5EMfiqChcWubG7mWK3Xz6nwNHBDNRE7XSKuUid9WD8eNBCG (12 Dec 2015 19:25:30 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Sat, 12 Dec 2015 19:25:30 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwFwYEBwCAIA7CXdEDBc7CV/09YEoYNpiPgMTHdH6lVUtt9l8GocfPzae+XSlNzVmXTT1kTUfDz8AzS5A+HfhaP |
| Cancel-Lock | sha1:aZsPQi9CnBt9ua64cJ+sdgKBTJM= |
| X-NNTP-Posting-Host | eJwFwQkBACAIA8BK8g2M41D6R/AuDIJOR8BjYlqmeN/ycLDWoYpe8KUW7qbbtgQPa9oGox8jBBFl |
| Xref | csiph.com de.comp.lang.php:3606 |
Show key headers only | View raw
Christoph M. Becker wrote:
> Am 05.10.2015 um 22:28 schrieb Thomas 'PointedEars' Lahn:
>> Das bedeutet auch, dass für Funktionen, die Methoden sind, die
>> Sichtbarkeit deklariert werden kann (siehe oben); für die übrigen
>> Funktionen jedoch nicht: Letztere sind entweder global deklariert, dann
>> sind sie immer sichtbar; oder sie sind lokal deklariert, dann sind sie
>> nur im lokalen Aufrufkontext sichtbar: […]
> Das ist so nicht ganz richtig. Eigentlich gibt es bei PHP (im Gegensatz
> zu manch anderen Programmiersprachen) keine lokalen Funktionen. Wird die
> Funktion "baz" im Rumpf der Funktion "bar" deklariert, so wird sie beim
> ersten Aufruf von bar() im globalen Gültigkeitsbereich definiert. […]
ACK. Faszinierend.
$ php -r 'function foo () { function bar() { echo "42\n"; } } foo(); bar();'
42
$ php -v
PHP 5.6.14-0+deb8u1 (cli) (built: Oct 4 2015 16:13:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend
Technologies
with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
--
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
Designfrage Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2015-09-10 11:48 +0000
Re: Designfrage Niels Braczek <nbraczek@freenet.de> - 2015-09-10 14:53 +0200
Re: Designfrage Claus Reibenstein <4spamersonly@kabelmail.de> - 2015-09-10 18:57 +0200
Re: Designfrage Gregor Kofler <usenet@gregorkofler.com> - 2015-09-11 00:54 +0200
Re: Designfrage Claus Reibenstein <4spamersonly@kabelmail.de> - 2015-09-11 12:07 +0200
Re: Designfrage failwell <steve@mindfav.com> - 2015-10-04 17:29 +0000
Re: Designfrage Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-05 22:28 +0200
Re: Designfrage Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-05 22:33 +0200
Re: Designfrage "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-12-12 19:16 +0100
Re: Designfrage Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-12 20:25 +0100
Re: Designfrage Andreas Treichel <gmblar@gmail.com> - 2015-11-01 11:09 +0100
csiph-web