Join Up!
104887 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousold_functionKlassen und Objektenext
Last updated: Mon, 28 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Spanish

Variablenfunktionen

PHP unterstützt das Konzept der Variablenfunktionen. Wenn Sie an das Ende einer Variablen Klammern hängen, versucht PHP eine Funktion aufzurufen, deren Name der aktuelle Wert der Variable ist. Dies kann unter anderem für Callbacks, Funktionstabellen, usw. genutzt werden.

Variablenfunktionen funktionieren nicht mit Sprachkonstrukten wie echo(), unset(), isset(), empty(), include() und print().

Beispiel 13-1. Beispiel für Variablenfunktionen

<?php
function blah()
{
    echo "In blah()<br>\n";
}

function fasel($arg = '')
{
    echo "In fasel(); der Parameter ist '$arg'.<br>\n";
}

$func = 'blah';
$func();
$func = 'fasel';
$func('test');
?>

Siehe auch Variable Variablen und function_exists().

User Contributed Notes
Variablenfunktionen
add a note about notes
There are no user contributed notes for this page.
previousold_functionKlassen und Objektenext
Last updated: Mon, 28 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST