Home » Tag Archives:ph (page 808)

Tag Archives: ph

'AND' vs '&&' as operator

November 7, 2017 Php Leave a comment

Questions: I have a codebase where developers decided to use AND and OR instead of && and ||. I know that there is a difference in operators’ precedence (&& goes before and), but...

Why check both isset() and !empty()

November 7, 2017 Php Leave a comment

Questions: Is there a difference between isset and !empty. If I do this double boolean check, is it correct this way or redundant? and is there a shorter way to do the same thing? isset($vars[1]) AND ...

How to check for null in Twig?

November 7, 2017 Php Leave a comment

Questions: What construct should I use to check whether a value is NULL in a Twig template? Answers: Depending on what exactly you need: is null checks whether the value is null: {% if var is null %} ...

Default value in Doctrine

November 2, 2017 Php Leave a comment

Questions: How do I set a default value in Doctrine 2? Answers: Database default values are not “portably” supported. The only way to use database default values is through the columnDefin...