# zend_parse_parameters changes not fully documented in phpng-upgrading, PR to fix existing tools

- Thread: https://externals.io/message/88454
- Original archive: https://news-web.php.net/php.internals/88454
- Started by Sean DuBois on 2015-09-23T20:39:39+00:00
- Messages: 4
- 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

---

## #88454 — Sean DuBois — 2015-09-23T20:39:39+00:00

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

Hey list,

'l' had a change 'long' -> 'zend_long' and 's' had a change 'int' -> 'size_t'.

These two changes are really hard to catch when porting an extension,
nothing complains at compile time, you don't get segfaults when calling
zend_parse* but usually later and it is platform dependent
(Windows for me when porting phpredis) I am lucky that I had a developer
(Jan-E) help me with this, or I would have pushed the extension out the door broken
for many people.

A.) Can someone merge https://github.com/php/php-src/pull/1521 this is currently
the only solution I know of to catch these things in an automated way

B.) Can someone give me access to https://wiki.php.net/phpng-upgrading so I can document
this

C.) Has there ever been a conversation about improving extension building so that authors
don't have to go out of their way to catch these things? I would really like to see phpize
kick out a Makefile that in the process of building/testing would raise alerts about this.

---

## #88470 — Derick Rethans — 2015-09-24T10:01:09+00:00

URL: https://externals.io/message/88454#88470 · In reply to: #88454

> Hey list,
> 
> 'l' had a change 'long' -> 'zend_long' and 's' had a change 'int' -> 
> 'size_t'.
> 
> These two changes are really hard to catch when porting an extension, 
> nothing complains at compile time, you don't get segfaults when 
> calling zend_parse* but usually later and it is platform dependent 
> (Windows for me when porting phpredis) I am lucky that I had a 
> developer (Jan-E) help me with this, or I would have pushed the 
> extension out the door broken for many people.
> 
> A.) Can someone merge https://github.com/php/php-src/pull/1521 this is 
> currently the only solution I know of to catch these things in an 
> automated way

I didn't know this script existed! I've added a few comments. Once 
resolved, I'll merge it.

> B.) Can someone give me access to https://wiki.php.net/phpng-upgrading 
> so I can document this

What's your wiki username?

> C.) Has there ever been a conversation about improving extension 
> building so that authors don't have to go out of their way to catch 
> these things? I would really like to see phpize kick out a Makefile 
> that in the process of building/testing would raise alerts about this.

Conversations yes, solutions, no. I'd be awesome to have this though.

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine

---

## #88477 — Sean DuBois — 2015-09-24T15:02:35+00:00

URL: https://externals.io/message/88454#88477 · In reply to: #88470

> 
>
> > […]
>
> I didn't know this script existed! I've added a few comments. Once
> resolved, I'll merge it.
>
> > […]
>
> What's your wiki username?
>
> > […]
>
> Conversations yes, solutions, no. I'd be awesome to have this though.
>
> cheers,
> Derick
>
> --
> http://derickrethans.nl | http://xdebug.org
> Like Xdebug? Consider a donation: http://xdebug.org/donate.php
> twitter: @derickr and @xdebug
> Posted with an email client that doesn't mangle email: alpine

Thanks for the review Derick! I addressed the issues you mentioned, and
hopefully it should be good to go!

My wiki username is Sean-Der

What do you think would be the most effective way to get everyones
suggestions? Continue this thread, RFC or start a new email
thread?

I would just like to see things like this script made more visible to
developers, that warn at compile time if users are using a non-public
component. Right now is there a way to know if something is going to
change, or if it safe to use?

---

## #88496 — johannes@schlueters.de — 2015-09-25T12:18:12+00:00

URL: https://externals.io/message/88454#88496 · In reply to: #88454

Hi,

> C.) Has there ever been a conversation about improving extension building so that authors
> don't have to go out of their way to catch these things? I would really like to see phpize
> kick out a Makefile that in the process of building/testing would raise alerts about this.

If you're using clang as compiler you can load this static analyzer
plugin: https://github.com/johannes/clang-php-checker

This will report such errors.

The mistakes you've mentioned are handled correctly in ther, but better
double check the type list in
https://github.com/johannes/clang-php-checker/blob/master/PHPZPPChecker.cpp#L72
in case there have been other recent changes. I haven't followed the
development.

johannes
