Is spprintf function necessary for RETURN_STRINGL in PHP extension?
PHPz
PHPz 2017-06-05 11:07:02
0
1
797

RT ", but no error will be reported when using the officially recommended spprintf function to assign values and obtain the length. Why is this?

PS: In the code in the picture, if the second parameter of RETURN_STRINGL is changed to 2, the same error will be reported. I changed it to 3 because I thought PHP would include the 0 at the end, but after trying it a few times, I found that it should not be the problem here

PHPz
PHPz

学习是最好的投资!

reply all (1)
習慣沉默

The string returned by RETURN_STRINGL must be the memory allocated by PHP memory management. It will be released by PHP itself after the end. spprintf is the PHP memory management used. In this case, you can set the third parameter to 1, which means that PHP itself allocates the corresponding memory to copy a string.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!