|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-06-01 13:38 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 16:00:01 2025 UTC |
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)