# regression in the new parameter parsing API, 5.3

- Thread: https://externals.io/message/42513
- Original archive: https://news-web.php.net/php.internals/42513
- Started by Pierre Joye on 2009-01-06T17:38:18+00:00
- Messages: 5
- 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

---

## #42513 — Pierre Joye — 2009-01-06T17:38:18+00:00

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

hi,

The new parameter parser introduced a regression (testing with
5.3-cvs) on how "z!" is processed. Example code:

if (0) {
	$authns = 1;
	$addtl = 1;
}
$result = dns_get_record("php.net", DNS_ANY, $authns, $addtl);
print_r($result);
var_dump($authns);
var_dump($addtl);

With 5.2, $authns and $addtl are correctly set (zval ptr is not NULL)
but 5.3 gives NULL. Sorry to do not try to fix it myself, I sadly lack
the time to take care of that right now.


Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #42515 — Hannes Magnusson — 2009-01-06T20:00:47+00:00

URL: https://externals.io/message/42513#42515 · In reply to: #42513

> hi,
>
> The new parameter parser introduced a regression (testing with
> 5.3-cvs) on how "z!" is processed. Example code:
>
> if (0) {
>        $authns = 1;
>        $addtl = 1;
> }
> $result = dns_get_record("php.net", DNS_ANY, $authns, $addtl);
> print_r($result);
> var_dump($authns);
> var_dump($addtl);
>
> With 5.2, $authns and $addtl are correctly set (zval ptr is not NULL)
> but 5.3 gives NULL. Sorry to do not try to fix it myself, I sadly lack
> the time to take care of that right now.

Its not the API that is b0rking things, its the full rewrite of the function.

z! means C NULL, not a zval IS_NULL, so the if (authns) and if (addtl)
checks will only kick in if the variables were initialized.

-Hannes

---

## #42516 — Pierre Joye — 2009-01-06T20:09:13+00:00

URL: https://externals.io/message/42513#42516 · In reply to: #42515

On Tue, Jan 6, 2009 at 9:00 PM, Hannes Magnusson
<hannes.magnusson@gmail.com> wrote:
> 
> > […]
>
> Its not the API that is b0rking things, its the full rewrite of the function.
>
> z! means C NULL, not a zval IS_NULL, so the if (authns) and if (addtl)
> checks will only kick in if the variables were initialized.

It is still a regression. The same code worked in 5.2.x but returns
nothing in 5.3+. We can argue than no notice (undefined variable) was
raised in 5.2 (or 5.3), but it worked and should still work, imo.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #42554 — Dmitry Stogov — 2009-01-11T10:37:47+00:00

URL: https://externals.io/message/42513#42554 · In reply to: #42513

The provided example works fine for me on both Linux and Windows.

Thanks. Dmitry.

Pierre Joye wrote:
> hi,
> 
> The new parameter parser introduced a regression (testing with
> 5.3-cvs) on how "z!" is processed. Example code:
> 
> if (0) {
> 	$authns = 1;
> 	$addtl = 1;
> }
> $result = dns_get_record("php.net", DNS_ANY, $authns, $addtl);
> print_r($result);
> var_dump($authns);
> var_dump($addtl);
> 
> With 5.2, $authns and $addtl are correctly set (zval ptr is not NULL)
> but 5.3 gives NULL. Sorry to do not try to fix it myself, I sadly lack
> the time to take care of that right now.
> 
> 
> Cheers,

---

## #42556 — Pierre Joye — 2009-01-11T12:43:14+00:00

URL: https://externals.io/message/42513#42556 · In reply to: #42554

> The provided example works fine for me on both Linux and Windows.

already fixed, I forgot to notify the list. The moves done in the new
dns api was wrong and the optional zval argument was wrong (z! has
another meaning).

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org
