<?xml version="1.0" encoding="UTF-8"?>
<PHP>print("hello world!\n"); //this is my comment</PHP> <PHP>print("this will be seen!");</PHP><PHP>try {&#13;
    echo 1;&#13;
    return;&#13;
} catch(Exception $e) {&#13;
    echo 2;&#13;
} catch(Exception $e) {&#13;
   echo 22;&#13;
}&#13;
echo 3;&#13;
</PHP>&#13;
&#13;
&#13;
<PHP>try {&#13;
        echo 1;&#13;
} catch(Exception $e) {&#13;
        echo 2;&#13;
        return;&#13;
}&#13;
echo 3;&#13;
</PHP>&#13;
&#13;
&#13;
&#13;
<PHP>function test() &#13;
{ &#13;
        $fields['company'] = ''; &#13;
        $fields['contact'] = ''; &#13;
        $fields['email'] = ''; &#13;
         &#13;
        return $fields; &#13;
}&#13;
$x = test();&#13;
var_dump($x);&#13;
</PHP>&#13;
&#13;
<PHP>function get_UID() {&#13;
global $User;&#13;
if (get_class($User)=='jwuser') {&#13;
return ($User-&gt;uid);&#13;
} else {&#13;
return 0; &#13;
}&#13;
}&#13;
</PHP>&#13;
&#13;
&#13;
<PHP>function GetHelpline() {&#13;
/**&#13;
* Returns the helpline number set&#13;
*/&#13;
&#13;
if ($this-&gt;GetCountry() == "uk") return&#13;
$this-&gt;texts["text"]["helpline-en"];&#13;
if ($this-&gt;GetCountry() == "ire") return&#13;
$this-&gt;texts["text"]["helpline-ire"];&#13;
if ($this-&gt;GetCountry() == "nz") return&#13;
$this-&gt;texts["text"]["helpline-nz"];&#13;
else return $this-&gt;texts["text"]["helpline-ot"];&#13;
}&#13;
</PHP>&#13;
&#13;
&#13;
<PHP>function fromUpload($data) {&#13;
	$img = new CImage;&#13;
 	$img-&gt;imageFilename = ObjectState::createID();&#13;
 	$img-&gt;imageMimeType = 'image/jpeg';&#13;
 	$img-&gt;uploadedFile = $data['tmp name'];&#13;
 	return $img;&#13;
 }&#13;
</PHP>&#13;
&#13;
&#13;
<PHP>// Returns an indexed array of associative arrays (including keys 'key',&#13;
    // 'name', 'desc', 'authorname', 'authorcontact', bool 'package_loaded',&#13;
    // array 'modules', array 'loaded_modules') of all currently registered&#13;
    // packages&#13;
    function EnumeratePackages()&#13;
    {&#13;
        // The array that's holding our output&#13;
        $out = array();&#13;
&#13;
        // Grab a Modules object&#13;
        $m = &amp;Modules::singleton();&#13;
&#13;
        // Go through our registry&#13;
        foreach ($this-&gt;_registry as $package)&#13;
        {&#13;
            // Create the associative array for this element&#13;
            $element = array(&#13;
                'key' =&gt; $package-&gt;key,&#13;
                'name' =&gt; $package-&gt;name,&#13;
                'desc' =&gt; $package-&gt;desc,&#13;
                'authorname' =&gt; $package-&gt;authorname,&#13;
                'authorcontact' =&gt; $package-&gt;authorcontact,&#13;
                'package_loaded' =&gt;&#13;
                    in_array($this-&gt;_loaded_packages, $package-&gt;key),&#13;
                'modules' =&gt; $m-&gt;EnumModulesByKey($package-&gt;key),&#13;
                'modules_loaded' =&gt; $m-&gt;EnumLoadedModulesByKey($package-&gt;key)&#13;
                );&#13;
&#13;
            // Add element to output array&#13;
            $out[$package-&gt;key] = $element;&#13;
        }&#13;
&#13;
        // Return output array&#13;
        return $out;&#13;
    }&#13;
&#13;
</PHP>&#13;
&#13;
&#13;
<PHP>$db = ("John");&#13;
	  	    &#13;
function display(){&#13;
	global $db;&#13;
	var_dump($db);&#13;
}&#13;
&#13;
display();&#13;
</PHP>&#13;
&#13;
&#13;
<PHP>function adds($var1, $var2){&#13;
	$i= $var1+$var2;&#13;
	if($i&gt;10) &#13;
		return $i;&#13;
	else&#13;
		return(adds($i,$i));&#13;
}&#13;
</PHP>&#13;
&#13;
<PHP>if(print("hello")){&#13;
	print("\ngood\n");&#13;
}&#13;
&#13;
</PHP><PHP>/******************************************/&#13;
/******currently doesn't work well!!!******/&#13;
/******************************************/&#13;
&#13;
$a=array(1,3,"a",7,0,"b",9);&#13;
&#13;
if($a[0]){&#13;
	print("that's good\n");&#13;
}&#13;
&#13;
if($a[4]){&#13;
	print("that's bad\n");&#13;
}&#13;
&#13;
 if(($a=array(1,2))){&#13;
 print("bye");&#13;
 }&#13;
&#13;
&#13;
</PHP><PHP>print("hello world!\n"); //this is my comment</PHP> <PHP>print("this will be seen!");</PHP><PHP>print("hello world!\n"); //this is my comment</PHP> <PHP>print("this will be seen!");</PHP><PHP>if(print("hello")){&#13;
	print("\ngood\n");&#13;
}&#13;
&#13;
</PHP><PHP>class Foo{&#13;
	var $x;&#13;
	function hell(){}&#13;
}&#13;
&#13;
if($a=new Foo()){&#13;
	print("bye");&#13;
}&#13;
</PHP> <PHP>function hello($x,$y){&#13;
	print("$x $y");&#13;
}&#13;
&#13;
hello(1,&amp;$a);&#13;
</PHP><PHP>$x=1;&#13;
$y=0;&#13;
&#13;
if($x==1)&#13;
if($y==0)&#13;
print("hello");&#13;
else print("else");&#13;
</PHP><PHP>define(foo,1);&#13;
&#13;
$a=foo;&#13;
print("$a");&#13;
&#13;
&#13;
define('boo',11);&#13;
$b=boo;&#13;
print("\n$b");&#13;
</PHP><PHP>define("foo");&#13;
$a=foo;&#13;
print("$a");&#13;
</PHP><PHP>$foo =2;&#13;
$i=5;&#13;
while($i)&#13;
{&#13;
	if($i&lt;=0) break;&#13;
	while($i)&#13;
	{&#13;
		if($i&lt;=0) break;&#13;
		while($i)&#13;
		{&#13;
			if($i&lt;=0) break;&#13;
			while($i)&#13;
			{&#13;
				if($i&lt;=0) break;&#13;
				break $foo;&#13;
			}&#13;
			print("level1\n");&#13;
			--$i;&#13;
		}&#13;
		print("level2\n");&#13;
		--$i;&#13;
	}&#13;
	print("level3\n");&#13;
	--$i;&#13;
}&#13;
print("level 4 - end\n");&#13;
</PHP><PHP>while(1){&#13;
	while(1){&#13;
		while(1){&#13;
			while(1){&#13;
				while(1){&#13;
					while(1){&#13;
						break 1000;&#13;
					}&#13;
				}&#13;
			}&#13;
		}&#13;
	}&#13;
}&#13;
&#13;
print("the end");&#13;
</PHP>&#13;
	<PHP>function hello_world($x,$y,$z)&#13;
{&#13;
	$z=$y=$x=0;&#13;
	$y=$x;&#13;
	$y=$z;&#13;
	$z=$y;&#13;
	$obj=new myClass();&#13;
	$obj-&gt;myFunc(1,8);&#13;
}&#13;
&#13;
class myClass{&#13;
	var $a;&#13;
	function myFunc($m,$n)&#13;
	{&#13;
		print("$m is the result");&#13;
	}&#13;
}&#13;
&#13;
hello_world(1,2,3);&#13;
</PHP><PHP>function hello($x){&#13;
	print("\nhello: $x\n");&#13;
}&#13;
&#13;
function globalHello($y){&#13;
	global $myVar;&#13;
	print("\ngHello: $y\n");&#13;
}&#13;
&#13;
hello(2);&#13;
globalHello(4);&#13;
&#13;
</PHP>&#13;
<PHP>function useMe()&#13;
{&#13;
	if($x&lt;10)&#13;
	print("the value is: $x\n");&#13;
}&#13;
&#13;
useMe(9);&#13;
</PHP>&#13;
<PHP>while($a&lt;7)&#13;
{&#13;
	print("ok");&#13;
	$a++;&#13;
}&#13;
</PHP>&#13;
	<PHP>while($a&lt;7)&#13;
{&#13;
	print("ok");&#13;
	$a++;&#13;
}&#13;
</PHP>&#13;
	<PHP>class NumberClass{&#13;
	function twoer()&#13;
	{&#13;
		$x=2;&#13;
		return $x;&#13;
	}&#13;
	&#13;
	function oner()&#13;
	{&#13;
		$x=3;&#13;
		$x++;&#13;
		return 1;&#13;
	}&#13;
}&#13;
&#13;
$a=new NumberClass();&#13;
$res=$a-&gt;oner();&#13;
print("$res");&#13;
$res=$a-&gt;twoer();&#13;
print("$res");&#13;
</PHP><PHP>function changeMe(&amp;$x)&#13;
{&#13;
	$x=3;&#13;
	print("changed to 3!\n");&#13;
}&#13;
&#13;
function DONTchangeMe(&amp;$x)&#13;
{&#13;
	print("i am what i am which is $x\n");&#13;
}&#13;
&#13;
$varvar=99;&#13;
DONTchangeMe($varvar);&#13;
changeMe($varvar);&#13;
</PHP><PHP>function changeMe(&amp;$x)&#13;
{&#13;
	$x=3;&#13;
	print("changed to 3!\n");&#13;
}&#13;
&#13;
function DONTchangeMe(&amp;$x)&#13;
{&#13;
	print("i am what i am which is $x\n");&#13;
}&#13;
&#13;
$varvar=99;&#13;
DONTchangeMe($varvar);&#13;
changeMe($varvar);&#13;
</PHP><PHP>function MyReTUrn($x)&#13;
{&#13;
	if($x&gt;5)&#13;
	return 1;&#13;
	elseif($x&gt;0)&#13;
	return 2;&#13;
	else&#13;
	return;&#13;
}&#13;
&#13;
$res=MyReTUrn(7);&#13;
print("i got $res\n");&#13;
</PHP><PHP>function noResponse($x)&#13;
{&#13;
	if($x&gt;0) {};&#13;
}&#13;
&#13;
$x=noResponse(-9);&#13;
print("$x");&#13;
</PHP><PHP>function noResponse($x)&#13;
{&#13;
	if($x&gt;0) {};&#13;
}&#13;
&#13;
$x=noResponse(-9);&#13;
print("$x");&#13;
</PHP>?&gt;<PHP>$path='c:\Documents and Settings\dubi\Desktop\test\1.php';&#13;
include($path);&#13;
include_once($path);&#13;
require($path);&#13;
require_once($path);&#13;
</PHP>&#13;
<PHP>$a=array(1,3,"a",7,0,"b",9);&#13;
&#13;
if($a[0]){&#13;
	print("that's good\n");&#13;
}&#13;
&#13;
if($a[4]){&#13;
	print("that's bad\n");&#13;
}&#13;
&#13;
if($a=array(1,5,"a",7)){&#13;
	print("that's a mistake!\n");\&#13;
}&#13;
&#13;
$c=0;	&#13;
if($c=array(1,5,"a",7)){&#13;
	print("that's a mistake!\n");&#13;
}&#13;
&#13;
</PHP><PHP>$variable = 1;&#13;
for($i=0;$i&lt;10;$i++) {&#13;
    $variable += $i;&#13;
    if($variale &gt; 10) { // typo here!&#13;
        echo $i;&#13;
    }&#13;
}&#13;
</PHP><PHP>if (time() %2 == 0){&#13;
  $boolean = true;&#13;
}&#13;
else{&#13;
  $boolean = false;&#13;
}&#13;
&#13;
	&#13;
if($boolean){&#13;
  print ("Zugi\n");&#13;
  exit ;&#13;
}&#13;
else{&#13;
 print ("I zugi\n");&#13;
 //if ($boolean==0)&#13;
 exit;&#13;
}&#13;
</PHP>&#13;
&#13;
abc &#13;
&#13;
<PHP>if(1)&#13;
{&#13;
	print("hello");&#13;
}&#13;
else&#13;
{&#13;
	print("bye");&#13;
}&#13;
</PHP>Source)