Generating PHP warnings
How can I generate PHP custom warnings in the same way as warnings for inline functions.
For example:
php > fopen(null);
PHP Warning: fopen() expects at least 2 parameters, 1 given in php shell code on line 1
php > fopen(null, 'w');
PHP Warning: fopen(): Filename cannot be empty in php shell code on line 1
php > fopen(array('a'), 'w');
PHP Warning: fopen() expects parameter 1 to be a valid path, array given in php shell code on line 1
Let's say I have a function like this:
function my_func($a, $b, $c);
What code can I use to my_func
give similar warnings when called incorrectly?
+3
source to share