#32664 [NEW]: public class function can be assigned like a public variable

From: Date: Mon, 11 Apr 2005 01:41:18 +0000
Subject: #32664 [NEW]: public class function can be assigned like a public variable
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-76624@lists.php.net to get a copy of this message
From: mizmerize at yahoo dot com Operating system: Windows 2000 Advanced Server SP3 PHP version: 5.0.4 PHP Bug Type: Class/Object related Bug description: public class function can be assigned like a public variable Description: ------------ I made a class that has a public function. If I assign a value to the function, PHP will allow to assign a value, and if I started to retrieve the value, it will return the value. Reproduce code: --------------- /*example*/ class Field { function GetField(){ } } /*usage*/ $m_Field=new Field; $m_Field->GetField="Hello"; echo $m_Field->GetField; /* please note the absence of parenthesis*/ Expected result: ---------------- it should produce a fatal error, concerning the assigning of the data in a function; Actual result: -------------- Hello /* returns the value you have set.*/ -- Edit bug report at http://bugs.php.net/?id=32664&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32664&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32664&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32664&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32664&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32664&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32664&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32664&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32664&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32664&r=support Expected behavior: http://bugs.php.net/fix.php?id=32664&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32664&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32664&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32664&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32664&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32664&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32664&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32664&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32664&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32664&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32664&r=mysqlcfg

« previous php.bugs (#76624) next »