Skip to content

Instantly share code, notes, and snippets.

@marciojrtorres
Created August 5, 2013 22:47
Show Gist options
  • Save marciojrtorres/6160320 to your computer and use it in GitHub Desktop.
Save marciojrtorres/6160320 to your computer and use it in GitHub Desktop.
Armadilhas da tipagem insegura em PHP
function soma($a, $b) {
return $a + $b;
}
// imprime 5, o PHP converte o 3 de string para inteiro
print(soma(2, "3"));
print(soma("12/01/2012", "30")); // o que será impresso?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment