<?php

$var = "VAR";

$var = isset($var) and $var != "VAR" ? $var : null;

print_r($var);