Same here, just do `new stdClass()` in the closure instead of using `$class`.