Skip to content

Instantly share code, notes, and snippets.

View timotheemoulin's full-sized avatar

Timothee Moulin timotheemoulin

View GitHub Profile
@timotheemoulin
timotheemoulin / PHP things
Last active October 15, 2020 06:13
Does PHP evaluate things the way you thought?
<?php
// counting values
var_dump(count(array())); // 0
var_dump(count(false)); // 1
var_dump(count(true)); // 1
var_dump(count(null)); // 0
var_dump(count(1)); // 1
var_dump(count(0)); // 1
var_dump(count('asdf')); // 1