Embed PHP code inside JavaScript? Good practice?

Is it acceptable if we use this coding style in our plugin? or will it be rejected?