best practice for converting a long to char* in a PECL extension?

From: Date: Wed, 03 Dec 2014 18:37:36 +0000
Subject: best practice for converting a long to char* in a PECL extension?
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-12459@lists.php.net to get a copy of this message
I'm working on a PECL extension and I need to convert a long: long index; into a char* that I can pass to another function. I obviously want to avoid buffer overflows and memory leaks and I'd also like to avoid introducing any code that is machine-dependent on the sizeo or endianness of a long. Is there some canonical/recommended way to accomplish this?

« previous php.pecl.dev (#12459) next »