# Fwd: [PHP-CVS] cvs: php-src /ext/gd gd.c gd_ctx.c /ext/ircg ircg.c /ext/mbstring php_mbregex.c /ext/msql php_msql.c /ext/mssql php_mssql.c /ext/mysql php_mysql.c /ext/mysqli mysqli_api.c /ext/oci8 oci8.c /ext/odbc php_odbc.c /ext/pcre ph

- Thread: https://externals.io/message/11335
- Original archive: https://news-web.php.net/php.internals/11335
- Started by Andi Gutmans on 2004-07-19T07:27:10+00:00
- Messages: 3
- 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

---

## #11335 — Andi Gutmans — 2004-07-19T07:27:10+00:00

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

Just a short clarification. Code which requires "" should use just that, e.g.:
         add_property_string(return_value, 
"table",(msql_field->table?msql_field->table:""), 1);
You can see that it's being duplicated anyway.

Code which really requires an emalloc'ed empty string should use 
STR_EMPTY_ALLOC()

Important to note especially for maintainers who will hopefully check that 
I didn't break anything.
Andi

>From: "Andi Gutmans" <andi@php.net>
>To: php-cvs@lists.php.net
>Date: Mon, 19 Jul 2004 07:19:52 -0000
>X-Security: message sanitized on mail.zend.com
>         See http://www.impsec.org/email-tools/sanitizer-intro.html
>         for details. $Revision: 1.143 $Date: 2004-04-10 09:05:42-07
>Old-Subject: [PHP-CVS] cvs: php-src /ext/gd gd.c gd_ctx.c  /ext/ircg 
>ircg.c  /ext/mbstring php_mbregex.c  /ext/msql php_msql.c  /ext/mssql 
>php_mssql.c  /ext/mysql php_mysql.c  /ext/mysqli mysqli_api.c  /ext/oci8 
>oci8.c  /ext/odbc php_odbc.c  /ext/pcre php_pcre.c  /ext/pgsql 
>pgsql.c  /ext/session session.c  /ext/standard file.c math.c reg.c 
>string.c var_unserializer.c var_unserializer.re  /ext/sybase 
>php_sybase_db.c  /ext/sybase_ct php_sybase_ct.c  /ext/wddx wddx.c  /main 
>php_ini.c safe_mode.c  /sapi/apache mod_php5.c  /sapi/apache2filter 
>php_functions.c sapi_apache2.c  /sapi/apache2handler php_functions.c 
>sapi_apache2.c  /sapi/apache_hooks mod_php5.c
>Subject: [PHP-CVS] cvs: php-src /ext/gd gd.c gd_ctx.c  /ext/ircg 
>ircg.c  /ext/mbstring php_mbregex.c  /ext/msql php_msql.c  /ext/mssql 
>php_mssql.c  /ext/mysql php_mysql.c  /ext/mysqli mysqli_api.c  /ext/oci8 
>oci8.c  /ext/odbc php_odbc.c  /ext/pcre ph
>X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.13.6.2
>
>andi            Mon Jul 19 03:19:52 2004 EDT
>
>   Modified files:
>     /php-src/ext/gd     gd.c gd_ctx.c
>     /php-src/ext/ircg   ircg.c
>     /php-src/ext/mbstring       php_mbregex.c
>     /php-src/ext/msql   php_msql.c
>     /php-src/ext/mssql  php_mssql.c
>     /php-src/ext/mysql  php_mysql.c
>     /php-src/ext/mysqli mysqli_api.c
>     /php-src/ext/oci8   oci8.c
>     /php-src/ext/odbc   php_odbc.c
>     /php-src/ext/pcre   php_pcre.c
>     /php-src/ext/pgsql  pgsql.c
>     /php-src/ext/session        session.c
>     /php-src/ext/standard       file.c math.c reg.c string.c
>                                 var_unserializer.c var_unserializer.re
>     /php-src/ext/sybase php_sybase_db.c
>     /php-src/ext/sybase_ct      php_sybase_ct.c
>     /php-src/ext/wddx   wddx.c
>     /php-src/main       php_ini.c safe_mode.c
>     /php-src/sapi/apache        mod_php5.c
>     /php-src/sapi/apache2filter php_functions.c sapi_apache2.c
>     /php-src/sapi/apache2handler        php_functions.c sapi_apache2.c
>     /php-src/sapi/apache_hooks  mod_php5.c
>   Log:
>   - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
>     used to return "" and not bool(false). It's not worth keeping it because
>     STR_FREE() and zval_dtor() always have to check for it and it slows down
>     the general case. In addition, it seems that empty_string has been abused
>     quite a lot, and was used not only for setting zval's but generally in
>     PHP code instead of "", which wasn't the intention. Last but not least,
>     nuking empty_string should improve stability as I doubt every place
>     correctly checked if they are not mistakenly erealloc()'ing it or
>     calling efree() on it.
>     NOTE: Some code is probably broken. Each extension maintainer should
>     check and see that my changes are OK. Also, I haven't had time to touch
>     PECL yet. Will try and do it tomorrow.
>
>
>--
>PHP CVS Mailing List (http://www.php.net/)

---

## #11337 — Wez Furlong — 2004-07-19T09:08:15+00:00

URL: https://externals.io/message/11335#11337 · In reply to: #11335

Please bump the API number for this, as PECL extensions need to check
it and still build with 5.0 and with HEAD.

--Wez.


> Just a short clarification. Code which requires "" should use just that, e.g.:
>          add_property_string(return_value,
> "table",(msql_field->table?msql_field->table:""), 1);
> You can see that it's being duplicated anyway.
> 
> Code which really requires an emalloc'ed empty string should use
> STR_EMPTY_ALLOC()
> 
> Important to note especially for maintainers who will hopefully check that
> I didn't break anything.
> Andi
> 
> > […]

---

## #11344 — Antony Dovgal — 2004-07-19T12:01:13+00:00

URL: https://externals.io/message/11335#11344 · In reply to: #11337

On Mon, 19 Jul 2004 10:08:15 +0100
Wez Furlong <kingwez@gmail.com> wrote:

> Please bump the API number for this, as PECL extensions need to check
> it and still build with 5.0 and with HEAD.

Btw, XDebug already doesn't compile with HEAD because of this change.

---
WBR,
Antony Dovgal aka tony2001
tony2001@phpclub.net || antony@dovgal.com
