Is it not possible to call a function in a switch statement? I am getting undefined function notice when I try to do the below.
class MyClass {
function myfunction($var)
{
unset($var);
}
function checkValue($val)
{
switch ($val) {
case 'hello':
myfunction($val);
break;
case 'goodbye':
echo "i equals 1";
break;
}
}
}
Yes, you are correct in your assumption that you needed: