PHP reference bug fix