Php

April 13, 2014
I choosed Php to develop websites.I never been a big fan, coming from Perl, but considering alternatives it does the job when you have your own functions and classes. I use php as a template language. Pros:
  • It’s populare
  • It’s mature
  • Easy to find some developers
  • It’s a good couple with Apache
Cons:
  • No real hash
  • It’s not Perl !
The table below is an easy reference for what these functions will return for different values. The blank spaces means the function returns bool(false).
Value of variable ($var) isset($var) empty($var) is_null($var)
“” (an empty string) bool(true) bool(true)
” ” (space) bool(true)
FALSE bool(true) bool(true)
TRUE bool(true)
array() (an empty array) bool(true) bool(true)
NULL bool(true) bool(true)
“0” (0 as a string) bool(true) bool(true)
0 (0 as an integer) bool(true) bool(true)
0.0 (0 as a float) bool(true) bool(true)
var $var; (a variable declared, but without a value) bool(true) bool(true)
NULL byte (“\ 0?) bool(true)

posted in Developer by nico

Follow comments via the RSS Feed| Trackback URL