#32664 [Opn->Bgs]: public class function can be assigned like a public variable

From: Date: Mon, 11 Apr 2005 06:23:22 +0000
Subject: #32664 [Opn->Bgs]: public class function can be assigned like a public variable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-76626@lists.php.net to get a copy of this message
ID: 32664 Updated by: derick@php.net Reported By: mizmerize at yahoo dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Windows 2000 Advanced Server SP3 PHP Version: 5.0.4 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2005-04-11 03:41:17] mizmerize at yahoo dot com 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 this bug report at http://bugs.php.net/?id=32664&edit=1

« previous php.bugs (#76626) next »