$this is not available to child fns in php5.3, use a closure instead...