Skip to content

Instantly share code, notes, and snippets.

Forked from jpauli/PHP gotcha 2013
Created January 8, 2014 21:00
What would you like to do?
$o1 = new stdclass($a=8);
var_dump($a); // Notice: Undefined variable: a
$o2 = new Datetime($b='now');
var_dump($b); // string "now"
Copy link

An enticing mystery but it's great once you get it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment