$opt1 = 100; $opt2 = 200; function &chooser($i) { global $opt1; global $opt2; if ($i < $opt1) { return $opt1; } else { return $opt2; } } $var =& chooser(150); $opt2 = 300; echo "\nReturn from chooser by reference: {$var}\n"; $var =& chooser(50); $opt1 = 120; echo "\nReturn from chooser by reference: {$var}\n"; //////testing object methods and reference parameters///// class cuntainted { var $v1 = 100; var $v2 = 200; function fref(&$s, $a = "") { echo "f received \$s as: {$s}\n"; $s .= $this->finternal() . $a; echo "f has left \$s as: {$s}\n"; return $this; } function &gref($v)
<?php @(include_once "inc/config.php") or die("Edit inc/config.php.sample first !"); require_once "inc/functions.php"; $view = chooser($_REQUEST['view']); display_view($view);