You get a notice because PHP doesn't treat functions as first class objects.
When you do this
$functions = array(t1, t2);
The PHP engine sees t1, and t2, and tries to resolve it as a constant, but because it cannot find a constant named t1/t2, it "assumes" that you wanted to type array('t1', 't2');
If you do a var_dump($functions), you can see that the items in the array are strings.
Eğer gibi, bir fonksiyonu olarak bir dize aramak için çalıştığınızda
$functions[0]()
PHP dizge olarak aynı adı taşıyan bir işlev için bakacağız. Ben bir işlev işaretçisi olarak bir dize kullanarak olarak bu çağrı değildir, bu daha çok yansıma kullanmak gibidir. PHP görüyorum, "değişkenli fonksiyonlar" çağırır:
http://hu2.php.net/manual/en/functions.variable-functions.php
Yani, bildirimler kurtulmak için doğru yolu:
$functions = array('t1', 't2');
Yok neden
't1'();
çalışmıyor? Ne yazık ki hiçbir cevap yoktur. PHP var, cehennem tuhaflıklar olarak rahatsız edici bu iyi bir sayı vardır. Sanki aynı cilvesi:
explode(':', 'one:two:three')[0];
Parse error: syntax error, unexpected '[' in php shell code on line 1
Edit:
The above mentioned array referencing syntax is available in PHP5.4, it's called array dereferencing.