#39681 [Opn]: this assignment outside class breaks static function call (PHP4 only)

From: Date: Fri, 23 Nov 2007 00:58:29 +0000
Subject: #39681 [Opn]: this assignment outside class breaks static function call (PHP4 only)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119973@lists.php.net to get a copy of this message
ID: 39681 Updated by: felipe@php.net Reported By: mail at jorgenhorstink dot nl Status: Open Bug Type: Class/Object related Operating System: FreeBSD PHP Version: 4.4.4 New Comment: In PHP 5.3: Fatal error: Using $this when not in object context Previous Comments: ------------------------------------------------------------------------ [2006-11-29 11:55:10] mail at jorgenhorstink dot nl Description: ------------ The code below shows the issue. Reproduce code: --------------- <?php $this->bug = 'PHP Should not allow assignment of $this properties when used outside a class'; class A { function B() { } } A::B(); ?> Expected result: ---------------- The engine should throw an error because setting a property on the $this object is senseless. Actual result: -------------- Warning: Problem with method call - please report this bug in xxx.php on line xx ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39681&edit=1

« previous php.bugs (#119973) next »