downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

関数のパラメータとしての整数値> <参照に関する処理の変更
Last updated: Fri, 13 Nov 2009

view this page in

[] の読み込み

<?php
class XmlTest {

    function 
test_ref(&$test) {
        
$test "ok";
    }

    function 
test($test) { }

    function 
run() {
        
$ar = array();
        
$this->test_ref($ar[]);
        
var_dump($ar);
        
$this->test($ar[]);
    }
}

$o = new XmlTest();
$o->run();
?>

これは常に E_ERROR レベルの致命的なエラーを発生します。なぜなら、PHP では [] を読み込みに使用できないからです。PHP 4.4.2 および PHP 5.0.5 以降で、 これは不正なコードとなりました。



add a note add a note User Contributed Notes
[] の読み込み
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites