From 80c8a16fb145f7ed4867d31fad3c22318a1ce708 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sat, 7 Dec 2013 13:12:25 -0800 Subject: replaces tabs in source code with regular spaces, added example for working with global variables --- .../functionwithparameters.php | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Examples/FunctionWithParameters/functionwithparameters.php') diff --git a/Examples/FunctionWithParameters/functionwithparameters.php b/Examples/FunctionWithParameters/functionwithparameters.php index 0ca360e..b1c3198 100644 --- a/Examples/FunctionWithParameters/functionwithparameters.php +++ b/Examples/FunctionWithParameters/functionwithparameters.php @@ -1,17 +1,17 @@ + * functionwithparameters.php + * @author Jasper van Eck * - * An example file to show the working of a function call with parameters, defined and undefined. + * An example file to show the working of a function call with parameters, defined and undefined. */ /* - * Test class. + * Test class. */ class MyPhpClass { - public $aMemberVar = "aMemberVar"; + public $aMemberVar = "aMemberVar"; public function __toString() { @@ -20,12 +20,12 @@ class MyPhpClass { public function getMemberVar() { - return $aMemberVar; - } + return $aMemberVar; + } } /* - * Run a function with parameters. + * Run a function with parameters. */ @@ -33,20 +33,20 @@ class MyPhpClass { * A function which takes parameters, which are all undefined; * my_with_undefined_parameters_function('1st','2nd','3rd','4th') */ -echo my_with_undefined_parameters_function('1st','2nd','3rd','4th') . "\n\n\n"; +echo my_with_undefined_parameters_function('1st','2nd','3rd','4th') . "\n\n\n"; /* * A function which takes parameters, which are all defined; * my_with_defined_parameters_function(21,42) */ - -echo my_with_defined_parameters_function(21,42) . "\n\n\n"; + +echo my_with_defined_parameters_function(21,42) . "\n\n\n"; /* * A function which takes a reference of a parameter * my_with_defined_parameters_reference_function(referenceVar) */ - + $referenceVar = "I am unchanged."; echo "The value of referenceVar: " . $referenceVar. "\n"; @@ -65,9 +65,9 @@ echo my_with_defined_array_parameters_function($myArray) . "\n\n\n"; * A function which takes an object as a parameter * my_with_defined_object_parameter_function(myPhpClass) */ - + $myPhpClass = new MyPhpClass; -echo my_with_defined_object_parameters_function($myPhpClass); +echo my_with_defined_object_parameters_function($myPhpClass); /* * Accessing a non-existant parameters index will result in a segmentation fault. -- cgit v1.2.3