ternary is weird in php