api: fix call-time pass-by-reference error

call-time pass-by-reference is a fatal error now (tested with php 5.5.6)