<?php
// int|string
42 --> 42 // tipo esatto
"42" --> "42" // tipo esatto
new ObjectWithToString --> "Risultato di __toString()"
// oggetto mai compatibile con int, ripiega su string
42.0 --> 42 // float compatibile con int
42.1 --> 42 // float compatibile con int
1e100 --> "1.0E+100" // float troppo grande per il tipo int, ripiega su string
INF --> "INF" // float troppo grande per il tipo int, ripiega su string
true --> 1 // bool compatibile con int
[] --> TypeError // array non compatibile con int o string
// int|float|bool
"45" --> 45 // stringa numerica intera
"45.0" --> 45.0 // stringa numerica float
"45X" --> true // non una stringa numerica, ripiega su bool
"" --> false // non una stringa numerica, ripiega su bool
"X" --> true // non una stringa numerica, ripiega su bool
[] --> TypeError // array non compatibile con int, float o bool
?>