Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] Difference between smart_str and smart_string

Posted by Ryan McCullagh 
Ryan McCullagh
[PHP-DEV] Difference between smart_str and smart_string
January 26, 2018 05:00AM
Hello internals,

I have been browsing php-src and notice smart_string, and smart_str, each with their header files. Why is there two seemingly identical structures with the same name?



--
Ryan McCullagh
ryanmccullagh.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sara Golemon
Re: [PHP-DEV] Difference between smart_str and smart_string
January 26, 2018 05:40AM
On Thu, Jan 25, 2018 at 10:50 PM, Ryan McCullagh <[email protected]> wrote:
> I have been browsing php-src and notice smart_string, and smart_str, each with their header files. Why is there two seemingly identical structures with the same name?
>
smart_string targets a raw char* buffer, smart_str targets a
refcountable zend_string*.
You'll almost always want the latter, except when you don't.

-Sara

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login