#44771 [Opn->Asn]: Calling nonstatic methods in context of another objects
| From: | dmitry@php.net | Date: | Fri, 18 Apr 2008 09:15:54 +0000 |
| Subject: | #44771 [Opn->Asn]: Calling nonstatic methods in context of another objects | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-124350@lists.php.net to get a copy of this message | ||
ID: 44771
Updated by: dmitry@php.net
Reported By: igor at webta dot net
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
PHP Version: 5.3CVS-2008-04-18 (snap)
-Assigned To:
+Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2008-04-18 06:58:30] igor at webta dot net
Description:
------------
Calling nonstatic methods in context of another objects
Reproduce code:
---------------
class A
{
public function bar ()
{
sort($this->arr);
}
}
class B
{
public $arr = array('a', 'c', 'b');
function run ()
{
A::bar();
var_dump($this->arr);
}
}
$b = new B();
$b->run();
Expected result:
----------------
Exception
Actual result:
--------------
Sorted array:
array
0 => string 'a' (length=1)
1 => string 'b' (length=1)
2 => string 'c' (length=1)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44771&edit=1