Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #3497
| 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 | Mon, 05 Oct 2015 22:33:02 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 48 |
| Message-ID | <2096934.Cc3SdgHTVJ@PointedEars.de> (permalink) |
| References | <1t55f16c9di4689n3e8%sfroehli@Froehlich.Priv.at> <murnm1$qlc$1@dont-email.me> <2915507.bUqziVz7J1@PointedEars.de> |
| Reply-To | Thomas 'PointedEars' Lahn <php@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1444077182 22225 eJwFwYEBACAEBMCVikfGEf3+I3Rn6ts74OYwGqEyuWanenY17KLp7yRFxgKyKEeiqK9wmR8TEREO (5 Oct 2015 20:33:02 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Mon, 5 Oct 2015 20:33:02 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwNxcEBwCAIA8CVBA3QcRow+4/Q3ueww6LzBOJAUN3itdbAujkVf4vbs9/DbtB9DcZiseb6JEjp2SlXCvwAimUXBw== |
| Cancel-Lock | sha1:fBeqOfylZZfd1WVuOgad0C6/dJM= |
| X-NNTP-Posting-Host | eJwNyskBwDAIA7CV6gKGjsMR9h8h1VsmBNuVRrW1bY3EeKmf0zI2X+7oH0B5gfXOiUYpoqT4XC+nEYY= |
| Xref | csiph.com de.comp.lang.php:3497 |
Show key headers only | View raw
Thomas 'PointedEars' Lahn wrote:
> Funktionen, deren Rückgabewert nicht mittels Parameter für die “return”-
> Anweisung angegeben wurde, haben in PHP implizit den Rückgabewert NULL:
>
> class C
> {
> private $answer = 42;
>
> public function foo ()
> {
> return $this->answer;
> }
Refactoring-Fehler: Hier sollte natürlich nur
public function foo () {}
stehen. Alternativ auch:
public function foo ()
{
return;
}
> […]
> }
>
> $instance = new C();
>
> /* class C#1 (0) { } */
> var_dump($instance);
>
> /* int(42) */
Copypaste-Fehler: Hier sollte natürlich
/* NULL */
stehen.
> var_dump($instance->foo());
--
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