I have an issue with php where code works on on computer but wont work on another
function appendParam(&$req, $name, $value) {
if (req == null) {
return;
}
if (name == null) {
return;
}
if (value != null) {
$req[$name] = $value;
}
}
The above works on one computer and is capable of checking req and name against null properly and the variables is the if condition don't need dollar signs (when i put the dollar signs in they break on this computer)
but i need to use the following code on another computer to get the same end result
function appendParam(&$req, $name, $value) {
if ($value != null) {
$req[$name] = $value;
}
if ($name == null) {
return;
}
if ($req == null) {
return;
}
}
on this other computer it isn't capable of checking name or req against null (it breaks) and i need the dollar signs on the variables in the if condition.
As a side note it also seems that this computer can't read from an array index that isn't already initialized.
Any help is appreciated