クラス内で定義された関数または変数を、クラス外からグローバル変数を使用せずに変更できますか?これはクラスが使用されている方法ですメインアプリケーションでPHP - クラス変数/関数をクラス外から変更する
class moo{
function whatever(){
$somestuff = "....";
return $somestuff; // <- is it possible to change this from "include file #1"
}
}
、::
が、これは内部のファイル#2が含まれ、クラスである中、インスタンス属性として
include "file1.php";
include "file2.php"; // <- this is where the class above is defined
$what = $moo::whatever()
...
「ファイル1を含める」とはどういう意味ですか? – Gordon
'$ somestuff'はローカル変数のようです。あなたは '$ what = moo :: whatever()'の後に '$ what'の値を変更できませんか? – BoltClock
「関数を変更する」とはどういう意味ですか? – Dogbert