如何让PHP在IF语句中回显错误?

How do i print an error if one of these are not working or rather not display some of these?

if ( $what === $toyota ) {
$print = "Camry";
} elseIF($what === $benz) {
$print = "S350";
} elseIF($what === $bmw) {
$print = "M5";
} elseIF($what === $honda) {
$print = "Accord";
} elseIF($what === $acura) {
$print = "mdx";
} elseIF($what === $jaguar) {
$print = "rx";
} elseIF($what === $landrover) {
$print = "rover";
} elseIF($what === $ford) {
$print = "sucks";
} elseIF($what === $gm) {
$print = "garbage";
} elseIF($what === $saturn) {
$print = "sat";
} elseIF($what === $jeep) {
$print = "not sure";
} elseIF($what === $chevy) {
$print = "whatever";
} elseIF($what === $porsche) {
$print = "Panamera";
} elseIF($what === $volkswagan) {
$print = "Passat";

}

print("$print");
}

}

Each one of your logic branches is comparing the variable $what to another variable named after a make of car. ie ($what === $honda) Where and what are you setting all these different variables to before the logic begins? Seems like it would be easier to write ($what === "honda") or use a switch statement like everyone recommends.

Also on printing out the variable, you don't need quotes.

Just print($print) and why not print($what) to see exactly what it is.

$map = array($wolskwagan => 'Passat', $chevy => 'whatever');
if (isset($map[$what])) print $map[$what]; else print 'error'; `

how about adding a simple else at the end ?

} elseIF($what === $volkswagan) {
    $print = "Passat";
} else {
    $print = "ERROR !!!";
}