The PAT directory contains patches (fixes and improvements for the C source code behind PHP) that have been sent to the internal developers’ mailing list by members of the wider PHP community. The mailing list is fairly busy – as are the developers – and patches aren’t always noticed by someone able to review and perhaps apply them; this can lead to people repeatedly mailing the same patch to the list in the belief that they’re being ignored!
Zend’s DevZone team keep these ‘ignored’ patches online here, where the PHP development team can easily find them, until we know that each patch offered to the PHP project has been properly reviewed. The fate of patches that are no longer in the PAT directory is explained in the PAT section in the Zend Weekly Summaries.
| 10 Feb 2007 | OpenID for OpenSSL/PHP 5 | Wez Furlong |
"I’d like to tuck the attached patch into the PHP 5 branch. It provides the following functions, and does not modify the behavior of any of the others:These functions allow one to implement OpenID and TypeKey authentication schemes without resorting to writing crypto code in user-space PHP–aside from the speed advantage, you have the benefit of using the tried and trusted OpenSSL for your DH kex." |
||
| 8 Feb 2007 | Persistence for zend_stack | Mike Wallner |
| "Patch is against CVS HEAD." | ||
| 24 Jan 2007 | Multicast support for ext/sockets | Daniel Rozsnyo |
| "Last year I made a patch for full multicast support, and I think it might be useful for others. Can somebody check if the implementation is correct (especially handling of params/args) and then include it in the official source code?" The patch was written against PHP 5.1.4. There is some background information here. Tested under Gentoo only. |
||
| 5 Jan 2007 | New array functions | John Bafford |
This patch implements three new functions: |
||
| 22 Dec 2006 | Recursive call to __get() error | Peter Hodge |
This patch for 5.2 provides an alternative error when you accidentally call__get() recursively when trying to access some property of a class.Currently, PHP says: Notice: Undefined property: someClass::$somePropertywhich makes it seem as though __get() is not called at all… |
||
| 15 Dec 2006 | OpenSSL PKCS12 for PHP_5_2 | Marc Delling |
This patch implements the functions: |
||
| 12 Dec 2006 | Extra space in php_java.jar | Alexandru Burciu |
| The extension is unable to load the library from the included php_java.jar because the net\php\reflect.properties file contains an extra space at the end of the line. This is a Windows only issue caused by misuse of the >file redirection operator when creating the .jar file. The patch fixes bug #33718 and |
||
| 7 Nov 2006 | Fix for apache2handler bug #39330 | Olexander Shtepa |
| The apache2handler SAPI registers cleanup functions only for the main Apache process, but Apache 2 cleans _only_ the child pool before it dies. This is the reason for unclean persistent connection closes (e.g. in pgsql). This patch adds shutdown actions registration to each child init, bringing thebehaviour in line with the Apache 1.3 handler. |
||
| 20 Oct 2006 | –with-apache-includes | Tim Starling |
| "Just something I noticed while compiling PHP 5.2.0RC6 on Windows. It looks like it’s been like this since the dawn of time, so it’s not a release blocker. The attached patch makes --with-apache-includes and--with-apache-libs work as documented." |
||
| 19 Oct 2006 | Parse error in HEAD | Matt Wilmas |
| "Probably not much chance of this happening, but while looking through HEAD’s lexer/parser code (which word is correct? rule to match a backslash followed by a \n newline inside single quotes,resulting in “Unexpected character in input …” The ST_SINGLE_QUOTE stateused to match this (as in 5.2), but was removed in version 1.132 of zend_language_scanner.l." |
||
| 18 Oct 2006 | mysql_set_charset() | Scott MacVicar |
| Patch for CVS HEAD updated by Scott, 8 February 2007. The other two still apply cleanly. "This patch adds mysql_set_charset() to the MySQLextension, which should be applied to all branches. The reason for the patch is that the mysql_set_character_set() functionprovided by the MySQL API sets the internal MySQL character set for the connection, which is referenced by functions such as mysql_real_escape_string().Without the ability to change the character set on the connection users have to use the SET NAMES ‘charset’ query, which lacks the ability to update theinternal character set. In certain cases this can lead to an SQL Injection. I’ll simply refer everyone to a blog entry by Ilia. I’d like this consider this a security issue and get it applied to the PHP 4 branch even though active development is more or less finished." |
||
| 3 Sept 2006 | MySQLi connection sharing | Evan Nemerson |
| "I’m working on an extension for an RDF triple store that is built on top of MySQL 5+, and I’d like to be able to share the MySQL connection with mysqli. Unfortunately, since the mysqli header isn’t installed, I can’t seem to find a way that could withstand changes in mysqli. What I’ve come up with is to create a trivial function which will take a (zval *)and return a (MYSQL *). I know it’s a bit of a hack, but I wastrying to be as unintrusive as possible." |
||
| 14 July 2006 | SimpleXML patch | Michael Gall |
"I really liked the recent changes that were made to simplexml (addChild()), but I think it needs the capability to add an existing simplexml element as a child. I’ve prepared a patch that adds a method (addElement()) to do this. It works, however it causes PHP to segfault on shutdown. I’m not exactly sure why it’s doing this (except that some resource hasn’t been incremented properly). I’m wondering if you could please take a look at the patch (it’s against PHP_5_1) and possibly provide some suggestions as to how to make this accepted into the tree." |
||
| 21 June 2006 | php_compat XML cleanup | Brian France |
| Brian had been trying to move an expat based extension to PHP 5, and felt that the XML parts of php_compat.h need some attention. The only alternatives available otherwise were for the application to move to libxml2, or else for PHP_COMPAT_H to be defined before the PHP headers were included. |
||
| 14 May 2006 | Read-only properties | Marcus Börger |
| This is Marcus’ response to Jason Garber’s request for read-only properties. A possibility for PHP 6, perhaps? | ||
| 13 March 2006 | ZSTR cast to union not working on g++ | Cristiano Duarte |
"In zend.h, ZSTR is defined like this:The problem is that g++ is also __GNUC__ and I just can’t get g++ to compilea code like this: So I found at gcc.gnu.org that the “Cast to Union” GNU extension is just for C not C++, here is the patch to the current CVS." |
||
| 24 Feb 2006 | Late static binding | Mike Lively |
| Patch reviewed and updated by Dmitry Stogov, 30 March 2006: "The problem is that this seldom-used feature will slow down each PHP call. I’ll measure performance loss next week. Please, test this patch too. I might have missed some edge cases." |
||
| 22 Dec 2005 | Fractional timeouts | Andreas Schiffler |
"This is the fractional timeout patch I made … its against the PHP_5_1 sources pulled from CVS this morning. It tries to cover all code that is found from a grep for default_socket_timeout and tv.tv_sec." |
||
| 10 Dec 2005 | LDAP control support | Pierangelo Masarati |
| Note: A more recent patch (dated 15 June 2006) is available on Pierangelo’s server. "This patch provides basic support for raw and well-known standard track LDAP controls and extended operations to the LDAP extension. It is intended for PHP HEAD code as of December 2005, but is known to apply to PHP 4 and 5. It should be preceded by the LDAP cleanup patch." |
||
| 10 Dec 2005 | OpenLDAP C API cleanup patch | Pierangelo Masarati |
| "This patch provides misc cleanup of the LDAP extension according to the OpenLDAP API 2.3 and up. It is intended for CVS HEAD as of December 2005, but it is known to apply to PHP 4 and 5. It should be backward compatible at least with OpenLDAP 2.2. All requested features are detected at compile time, so it should not cause problems with any other LDAP API; simply, the extensions will not be available." | ||
| 5 Dec 2005 | glob() fixes for the 4_4 branch | Marcin Obara |
| See issue #266 for details (long-ish explanation). This still needs evaluation. | ||
| 10 Nov 2005 | Fix for ext/socket bug | Nuno Lopes |
| "This is a possible fix for ext/socket bug #21197. I haven’t tested bug #35062, but it seems to be a different bug…" | ||
| 30 July 2005 | Negative value for string offsets | Val Khokhlov |
"This is a small patch that allows a negative value for offset in $string{offset}and so on…" |
||
| 29 June 2005 | FastCGI memory management (reference only) | Andrew Prendergast |
"This patch implements my proposed PHP_FCGI_MAX_RAM_MB & PHP_FCGI_MAX_RAM_INCREASE changes. Compile with-DDEBUG_FASTCGI to see whats going on. For details, see Issue #242"Note: This patch is stored here for reference following a revival of interest in Feb 2007. |
||
| 26 June 2005 | array_reduce() | David Tulloh |
"This is a trivial patch to allow array_reduce() to have a mixed starting value. All the tests passed with this modification (that passed without it). I also included a test file which tests the new functionality and provides a few examples of what it could be useful for. See bug #33447." |
||
| 6 June 2005 | dl() and shutdown, revisited | Wez Furlong |
"I just spent the last hour or so tracking down a couple of mysterious ‘ht is already destroyed’ messages. It turns out that this is caused by zend_clean_module_rsrc_dtors_cb() attempting to apply a callback function to the regular and persistent lists. At the time this is called, those lists have already been destroyed. The attached patch is something of a hack to avoid bailing out in this case. There might be a better way to handle this. The problem only occurs with dl()‘d modules that register resources." |
||
| 26 May 2005 | Double free, symbol table corruption in openssl | Kamesh Jayachandran |
"The culprit is php_openssl_evp_from_zval() which is called by openssl_public_encrypt(). openssl_public_encrypt() reduces the refcount of $pk from 2 to 1. zend_ptr_stack_clear_multiple() reduces it again to 0 as a normal cleanup upon return from openssl_public_encrypt(). And hence zval associated with $pk is getting freed. But symbol table still refers to freed pointer." |
||
| 2 May 2005 | Fix possible segfault with mb_ereg_replace | Kamesh Jayachandran |
"_php_mb_regex_ereg_replace_exec() in php_mbregex.c returns:RETVAL_STRINGL((char *)out_buf.c, out_buf.len - 1, 0);At the end of the function 0 as the 3 argument to RETVAL_STRINGL Macro does not duplicate the content and sets a retval zval same as out_buf.c. out_buf.c is allocated using malloc/realloc family not emalloc/erealloc. While zval_ptr_dtor() is called on mb_reg_replace()‘s retval, calls efree() (which it should not.). Hence in the macroREMOVE_POINTER_FROM_LIST p->pLast->pNext = p->pNext;line causes a seg fault.(As p->pLast is null or some strange pointer not within the control of the running program) Patch is for 5.0 tree" |
||
| 13 March 2005 | PHP code highlighted with linenumbers | Johannes Schlüter |
"I’ve implemented line numbering with <ol> and added an optional bool parameter to the highlight functions. Additionally I’ve added two other parameters to these functions: The first one is a bool that adds jump targets (<a id="[line]"/>), second one is a prefix to this number (<a id="[prefix][line]"/>) which is needed to make sure the jump target is unique. This doesn’t work with .phps yet since we would need a new php.ini setting which I didn’t want to add, or numbered output would need to become default." |
||
| 7 March 2005 | A return value for throw | Sara Golemon |
"A user was asking about why he could perform statements such as:$db = mysql_connect('localhost') or die('Unable to connect to database server');But not: $db = new mysqli('localhost') or throw('Unable to connect to database server');…" |
||
| 10 Feb 2005 | Support for PGSQL’s geometric types | Benj Carson |
"This patch for pg_convert() adds support for PostgreSQL’s geometric types (point, line, box, path, polygon and circle). It also fixes some issues with the regexs for interval types I wrote in a previous patch. The patch is against CVS HEAD." |
||
| 3 Feb 2005 | ReflectionProperty getLinenumber | Johannes Schlüter |
"This method corresponds to the already existing Reflection[Class|Function|Method]::get[Start|End]Line() methods. As you can see I extended the zend_property_info() structure to hold the linenumber. If an extension registers a property using zend_declare_property(), it is assumed that the property was defined at line 0." |
||
| 17 Nov 2004 | Browscap parser | Jay Smith |
| This browscap parser was written with the hope of getting it into PHP 5.1.0… | ||
| 24 Aug 2004 | New function: posix_setrlimit() | Marcin Gibuła |
"This patch adds the posix_setrlimit() function to the posix extension. The function can be useful in standalone apps to lower your resources limits (for example cpu limit)." |
||
| 27 July 2004 | Ref counting for odbc_connection resources | Dave Lawson |
Reference deletion and odbc_connection caching issues. |
||
| 27 July 2004 | odbc resource leaks | Dave Lawson |
"Several odbc functions do not initialize the id member, causing the delete to silently fail and the resource to stay allocated. As id doesn’t appear to be used, why not just use the value of the zval passed in to odbc_free_result()?" |
||
| 27 July 2004 | FP/DECIMAL/ROUNDING ISSUES | George Whiffen |
| Please see George’s long and detailed description. All three ‘udiffs’ are together in one file here. | ||
| 21 July 2004 | hijri.c | Mostapha |
| Mostapha mailed this to the internals list in the hope that someone could help him implement the Islamic calendar as part of ext/calendar. | ||




January 22, 2007 at 12:23 am
so if something is in the PAT directory for over a month – does that mean it is pretty much dead?
January 26, 2007 at 1:21 am
Hi Lig,
No, basically the patches that are still here are the ones that neither went in nor got a review. E.g. large amounts of LDAP work from someone on the OpenLDAP team that nobody on the PHP core team has had time to test (there’s no dedicated maintainer for the LDAP extension at present). E.g. a copy of hijri.c that – as far as I know – is still quite likely to be the only working version of hijri.c out there. Y’know, _stuff_
- Steph