On adapte le code à la nouvelle API Zend, au nouveau packaging Debian (plus
de conf.d partagé entre apache2 & cli), et on utilise
./scripts/dev/check_parameters.php de la source PHP pour corriger toutes les
erreurs de paramètres, comme décrit sur
https://github.com/php/php-src/blob/master/README.PARAMETER_PARSING_API. Modifs
principales : ne pas initialiser les valeurs non optionnelles, et stocker les
« int » PHP sous forme de long pour être 64 bit-compliant.

 (extrait du lien ci-dessus :)

Note on 64bit compatibility
---------------------------
Please do not forget that int and long are two different things on 64bit
OSes (int is 4 bytes and long is 8 bytes), so make sure you pass longs to "l"
and ints to strings length (i.e. for "s" you need to pass char * and int),
not the other way round!
Remember: "l" is the only case when you need to pass long (and that's why
it's "l", not "i" btw).

Both mistakes cause memory corruptions and segfaults on 64bit OSes:
1)
  char *str;
  long str_len; /* XXX THIS IS WRONG!! Use int instead. */
  zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)

2)
  int num; /* XXX THIS IS WRONG!! Use long instead. */
  zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num)

If you're in doubt, use check_parameters.php script to the parameters
and their types (it can be found in ./scripts/dev/ directory of PHP sources):

:# php ./scripts/dev/check_parameters.php /path/to/your/sources/