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

From: Date: Sun, 25 Nov 2007 10:31:53 +0000
Subject: #39681 [Opn->Bgs]: this assignment outside class breaks static function call (PHP4 only)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120032@lists.php.net to get a copy of this message
 ID:               39681
 Updated by:       derick@php.net
 Reported By:      mail at jorgenhorstink dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: FreeBSD
 PHP Version:      4.4.4
 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

Can't reproduce this in 4.4.7 or any version after that.


Previous Comments:
------------------------------------------------------------------------

[2007-11-23 00:58:29] felipe@php.net

In PHP 5.3:
Fatal error: Using $this when not in object context

------------------------------------------------------------------------

[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


Thread (3 messages)

« previous php.bugs (#120032) next »