Assign children to a variable before setting to a by-ref variable.

Fixes strict standards notice in PHP 5.5.