Use the Z_ADDREF_P macro to increasing the refcount of PHP values assigned to V8.