Posts tagged ‘typecast’

Python vs. PHP duck typing

Having previous experience in writing PHP code could potentially lead you to hours of debugging in Python.
Consider the following simple example in PHP:

PHP


$s = "0";
$my = (bool) $s;

var_dump($s);
var_dump($my)

Continue reading ‘Python vs. PHP duck typing’ »