ID: 20089 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Solaris PHP Version: 4.2.3 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 Also, this was discussed before (in both the bugdatabase and on the developer mailinglist) and this behavior will not be changed in the near future. Previous Comments: ------------------------------------------------------------------------ [2002-10-25 11:08:54] [EMAIL PROTECTED] Here is an example ... <?php class Foo { function Foo() { $this->class = 'foo'; } function doCall() { return Bar::staticFunction(); } }; class Bar { function staticFunction() { if ( isset( $this ) ) { print 'This isset <br />'; print_r( $this ); } else { print 'Call as a static <br />'; } } }; $foo =& new Foo(); $foo->doCall(); ?> Note an instance of Foo is calling a static method of Bar. Bar does a test to see if $this is set. $this should not be set, since the method was statically invoked. Unfortunately, $this is set and its the instance of Foo that made the call to the static method of Bar. This bug makes writing methods that work both as static methods and instance methods virtually impossible. It is also extremely unsafe to allow Bar to access the member variables of Foo. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20089&edit=1