diff options
Diffstat (limited to 'Examples/FunctionWithParameters/functionwithparameters.php')
-rw-r--r-- | Examples/FunctionWithParameters/functionwithparameters.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Examples/FunctionWithParameters/functionwithparameters.php b/Examples/FunctionWithParameters/functionwithparameters.php new file mode 100644 index 0000000..04a0cb6 --- /dev/null +++ b/Examples/FunctionWithParameters/functionwithparameters.php @@ -0,0 +1,21 @@ +<?php +/* + * functionwithparameters.php + * @Author Jasper van Eck + * + * An example file to show the working of a function call with parameters, defined and undefined. + */ + +/* + * Run a function with parameters. + */ +echo 'A function which takes parameters, which are all undefined;' . + '\nmy_with_undefined_parameters_function("1st","2nd","3rd","4th")\n'; +echo my_with_undefined_parameters_function("1st","2nd","3rd","4th") . '\n'; + +echo 'A function which takes parameters, which are all defined;' . + '\nmy_with_defined_parameters_function(21,42)\n'; +echo my_with_defined_parameters_function(21,42) . '\n'; + +echo 'Accessing a non-existant parameters index will result in a segmentation fault.\n'; +echo 'The segmentation fault will also occur when passing the wrong type of parameter.\n'; |