申し訳ありませんが、この回答はインターネット上のどこかにあると確信していますが(おそらくスタックオーバーフローでさえ)、過去1時間検索に費やしたので、回答が見つからないようです...
PHP の extract() 関数は、コピー オン ライトを使用してシンボル テーブルに変数を追加しますか?
PHP 関数呼び出しはすべてデフォルトでコピー オン ライトであることを知っています (参照によって指定しない限り)。テンプレートファイルを含める前にそれらを抽出することが最善の方法であるかどうか疑問に思っています.
ありがとう!
編集:
明確にするために:
$array = array('a' => array(1,2,3), 'b' => array(3,4,5), 'c' => array(6,7,8));
extract($array);
//is $a, $b, $c Copy-On-Write at this point? Would be a lot better performance as opposed to allocating 3 new array()'s
//I would like to avoid having this change the original $array values so using EXTR_REFS is not a good solution for me here if I can avoid it and still keep performance!
$a = array(3);