# [PATCH] Allow null to string conversion for PHP 6

- Thread: https://externals.io/message/36524
- Original archive: https://news-web.php.net/php.internals/36524
- Started by Christian Schneider on 2008-03-26T00:55:20+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

---

## #36524 — Christian Schneider — 2008-03-26T00:55:20+00:00

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

Playing around with PHP 6 I noticed that some functions start to 
complain about conversion of null values to strings:

php -d error_reporting=65535 -r 'var_dump(urldecode(null));'

Warning: `urldecode()` expects parameter 1 to be strictly a binary string, 
null given in Command line code on line 1

I think this is wrong and attached a patch against HEAD to fix this. 
Note: While the patch seems a bit hacky at first it is IMHO the simplest 
solution without having to resort to copy/paste or goto. But if you want 
another solution I'm happy with that too :-)

- Chris

---

## #36528 — Antony Dovgal — 2008-03-26T09:08:33+00:00

URL: https://externals.io/message/36524#36528 · In reply to: #36524

> Playing around with PHP 6 I noticed that some functions start to 
> complain about conversion of null values to strings:
> 
> php -d error_reporting=65535 -r 'var_dump(urldecode(null));'
> 
> Warning: `urldecode()` expects parameter 1 to be strictly a binary string, 
> null given in Command line code on line 1

I applied slightly different patch, but it does exactly the same.
Thanks for the heads up.

-- 
Wbr, 
Antony Dovgal
