Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4300
| From | k@rl.pflaesterer.de (Karl Pflästerer) |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat |
| Date | 2017-10-11 16:38 +0200 |
| Message-ID | <m1k20192cj.fsf@mbp.pflaesterer.de> (permalink) |
| References | (3 earlier) <oriedd$b5b$1@solani.org> <2895559.aeNJFYEL58@PointedEars.de> <oriu7h$m6v$1@solani.org> <1996348.iZASKD2KPV@PointedEars.de> <orjjhl$4vg$1@solani.org> |
"Christoph M. Becker" <cmbecker69@arcor.de> writes:
> Am 10.10.2017 um 20:24 schrieb Thomas 'PointedEars' Lahn:
>
>> Christoph M. Becker wrote:
>>
>>> Dann stellt sich mir allerdings die Frage, wieso
>>> <https://3v4l.org/pO3N9> und <https://3v4l.org/8Wde8> ein so
>> ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
>>> unterschiedliches Ergebnis haben.
>>
>> Bitte nicht (nur) so.
>
> Du hast natürlich recht (Usenet != WWW); also Präambel:
>
> class C {
> public function __set ($property, $value) {
> $this->$property = 'baz';
> }
> }
> $a = 'bar';
> $o = new C();
>
> Und dann:
>
> echo ($a .= ($o->x .= "foo"));
> echo "\n". $o->x . "\n";
>
> vs.:
>
> echo ($a = $a . ($o->x = $o->x . "foo"));
> echo "\n". $o->x . "\n";
>
> Man könnte annehmen, dass beide Varianten die selbe Ausgabe produzieren,
> aber die zweite Zeile ist (sowohl bei PHP als auch bei HHVM):
>
> foo
>
> beziehungsweise:
>
> baz
>
> Also ist ($a .= $b) nicht unbedingt äquivalent zu ($a = $a . $b)
> (Pseudocode; siehe oben). Aber wie kann man dieses Verhalten (griffig)
> beschreiben?
Ist es denn ein Bug oder Feature das .= oder += nicht __set() aufruft?
KP
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Josh Mehrtens <jom@mail.invalid> - 2017-10-07 16:19 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-07 19:49 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-08 03:19 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Josh Mehrtens <jom@mail.invalid> - 2017-10-10 13:37 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-10 14:28 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-10 15:31 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2017-10-10 13:58 +0000
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-10 16:07 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-10 18:58 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-10-10 20:24 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-11 01:02 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat k@rl.pflaesterer.de (Karl Pflästerer) - 2017-10-11 16:38 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-12 00:45 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-07 19:49 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Josh Mehrtens <jom@mail.invalid> - 2017-10-07 23:40 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-10-08 01:13 +0200
Re: prüfen ob eine Funktion etwas ausgibt / - Inhalt hat Josh Mehrtens <jom@mail.invalid> - 2017-10-10 13:34 +0200
csiph-web