|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-14 16:02 UTC] rasmus@php.net
-Status: Open
+Status: Bogus
[2010-04-14 16:02 UTC] rasmus@php.net
[2010-04-14 20:04 UTC] sinisaculic at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 01:00:01 2025 UTC |
Description: ------------ I know it is uncommon usage of reference but i have a pretty complicated equation inside a function, and i referenced a value like $a &= %this->bla... It is easier to write $a instead $this->a... in case you have a BIG equation... And imagine my surprise when i saw that the value was not set... my guess is that this code somehow screws the internal references.... Searched here and nothing showed up for classes... just run the script it should output the error... don`t know about UNIX OP but i doubt it is different... here is how i get the error: class a { public $t; function buga(){ $this->t = 'buga'; } function bla(){ $b &=$this->t; echo $b; } } $a= new a; $a->buga(); $a->bla(); //this outputs Notice: Undefined variable: b in C:\...\test.php on line XX I use Wamp Server package 2.0f latest version... Hope i was right about it... if not, Sorry... With respect Siniša Čulić at sinisaculic@gmail.com Test script: --------------- class a { public $t; function buga(){ $this->t = 'buga'; } function bla(){ $b &=$this->t; echo $b; } } $a= new a; $a->buga(); $a->bla(); //this outputs Notice: Undefined variable: b in C:\...\test.php on line XX Expected result: ---------------- This should output just bla Actual result: -------------- But it outputs a notice... and no variable... this outputs Notice: Undefined variable: b in C:\...\test.php on line XX