# Difference between smart_str and smart_string

- Thread: https://externals.io/message/101684
- Original archive: https://news-web.php.net/php.internals/101684
- Started by Ryan McCullagh on 2018-01-26T03:50:30+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #101684 — Ryan McCullagh — 2018-01-26T03:50:30+00:00

URL: https://externals.io/message/101684#101684

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

---

## #101685 — Sara Golemon — 2018-01-26T04:35:06+00:00

URL: https://externals.io/message/101684#101685 · In reply to: #101684

> 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
