One more (was Re: [PHP-GTK] Assignment evalution weirdness)
| From: | Markus Fischer | Date: | Fri, 10 Aug 2001 11:58:03 +0000 |
| Subject: | One more (was Re: [PHP-GTK] Assignment evalution weirdness) | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-2726@lists.php.net to get a copy of this message | ||
In the same context, e.g. in a method from a class extending
GtkWindow:
// we assume $this->hash = array();
var_dump( $this->hash[ 'foo']); // NULL
$test = $this->hash;
var_dump( $test[ 'foo']); // NULL, too, its ok
if( isset( $test[ 'foo'])) { // works, doesn't enter the if
// but
if( isset( $this->hash[ 'foo'])) { // enters the if here
- Markus
On Fri, Aug 10, 2001 at 12:46:49PM +0200, Markus Fischer wrote :
> Example one (without using Gtk)
>
> <?
> class foo {
> function foo() {
> $a = 3;
> if( ( $this->b = $a) == 3) {
> echo "3\n";
> }
> }
> }
>
> $obj = new foo;
>
> ?>
>
> when ran outputs 3
>
>
> Same with extending GtkWindow:
>
> <?
> dl( 'php_gtk.so');
>
> class foo extends GtkWindow {
> function foo() {
> $a = 3;
> if( ( $this->b = $a) == 3) {
> echo "3\n";
> }
> }
> }
>
> $obj = new foo;
>
> ?>
>
> when ran outputs nothing (in other words: the assignment evalutes
> to NULL, verified with a dump_var).
>
>
> this isn't expected, isn't it ?
>
> (btw, in the first example you can extend foo and it still works)
>
> - Markus
>
>
>
> --
> Markus Fischer, http://guru.josefine.at/~mfischer/
> EMail: mfischer@guru.josefine.at
> PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
> PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0
>
> --
> PHP GTK Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
> For additional commands, e-mail: php-gtk-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Markus Fischer, http://guru.josefine.at/~mfischer/
EMail: mfischer@guru.josefine.at
PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0