<?
try {
    echo 1;
    return;
} catch(Exception $e) {
    echo 2;
} catch(Exception $e) {
   echo 22;
}
echo 3;
?>


<?
try {
        echo 1;
} catch(Exception $e) {
        echo 2;
        return;
}
echo 3;
?>



<?
function test() 
{ 
        $fields['company'] = ''; 
        $fields['contact'] = ''; 
        $fields['email'] = ''; 
         
        return $fields; 
}
$x = test();
var_dump($x);
?>

<?php

function get_UID() {
global $User;
if (get_class($User)=='jwuser') {
return ($User->uid);
} else {
return 0; 
}
}
?>


<? 
function GetHelpline() {
/**
* Returns the helpline number set
*/

if ($this->GetCountry() == "uk") return
$this->texts["text"]["helpline-en"];
if ($this->GetCountry() == "ire") return
$this->texts["text"]["helpline-ire"];
if ($this->GetCountry() == "nz") return
$this->texts["text"]["helpline-nz"];
else return $this->texts["text"]["helpline-ot"];
}
?>


<?
function fromUpload($data) {
	$img = new CImage;
 	$img->imageFilename = ObjectState::createID();
 	$img->imageMimeType = 'image/jpeg';
 	$img->uploadedFile = $data['tmp name'];
 	return $img;
 }
?>


<?php

    // Returns an indexed array of associative arrays (including keys 'key',
    // 'name', 'desc', 'authorname', 'authorcontact', bool 'package_loaded',
    // array 'modules', array 'loaded_modules') of all currently registered
    // packages
    function EnumeratePackages()
    {
        // The array that's holding our output
        $out = array();

        // Grab a Modules object
        $m = &Modules::singleton();

        // Go through our registry
        foreach ($this->_registry as $package)
        {
            // Create the associative array for this element
            $element = array(
                'key' => $package->key,
                'name' => $package->name,
                'desc' => $package->desc,
                'authorname' => $package->authorname,
                'authorcontact' => $package->authorcontact,
                'package_loaded' =>
                    in_array($this->_loaded_packages, $package->key),
                'modules' => $m->EnumModulesByKey($package->key),
                'modules_loaded' => $m->EnumLoadedModulesByKey($package->key)
                );

            // Add element to output array
            $out[$package->key] = $element;
        }

        // Return output array
        return $out;
    }

?>


<?php
$db = ("John");
	  	    
function display(){
	global $db;
	var_dump($db);
}

display();
?>


<?
function adds($var1, $var2){
	$i= $var1+$var2;
	if($i>10) 
		return $i;
	else
		return(adds($i,$i));
}
?>

