A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearVariable watch in PHP - page 1
User InfoPosts
Variable watch in PHP#1
Does PHP have the ability to watch a variable (or object property) and run a function when its value changes, similar to Gecko's Javascript watch function?

posted date: 2008-12-21 18:34:00


Re: Variable watch in PHP#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-21 18:34:01


Re: Variable watch in PHP#3
XDebugmight have this, but I don't know for sure.If you're trying to debug a member variable on an object, you can use overloading:public function __set($var, $val){ if ($var == 'interesting') { echo "$var set to: "; var_dump($val); } $this->$var = $val;}

posted date: 2008-12-21 19:01:00


Re: Variable watch in PHP#4
According to PHP docs (us3.php.net/manual/en/language.oop5.overloading.php) : "__set() is run when writing data to inaccessible members." It doesn't filter all member accesses.

posted date: 2008-12-21 19:03:00


Re: Variable watch in PHP#5
This would be possible when using XDebug along side an IDE like eclipse.

posted date: 2008-12-22 03:55:00


Re: Variable watch in PHP#6
Do you want to detail what the ultimate goal is? E.g. just being able to watch a var, or something else which you need the watch for?

posted date: 2008-12-22 05:19:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.