fix misuse of TSRMLS_D