problems with ternary operator in php