Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35352 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93341 invoked by uid 1010); 11 Feb 2008 05:51:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93326 invoked from network); 11 Feb 2008 05:51:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2008 05:51:26 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:36895] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/80-64922-E52EFA74 for ; Mon, 11 Feb 2008 00:51:26 -0500 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 04DEFC0E964; Sun, 10 Feb 2008 22:51:24 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id AA627C0E962; Sun, 10 Feb 2008 22:51:23 -0700 (MST) Message-ID: <47AFE273.7030103@chiaraquartet.net> Date: Sun, 10 Feb 2008 23:51:47 -0600 User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Marcus Boerger , internals Mailing List X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: BC break in DirectoryIterator by fix of #44018 From: greg@chiaraquartet.net (Gregory Beaver) Hi Marcus, FYI, this change: http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?view=diff&r1=1.146&r2=1.147 breaks about 20 tests in phar, it's a potentially serious BC break. I understand the reasoning behind it, but you may find other users up in arms. The main problem is that this line: flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF; returns the DirectoryIterator object as current instead of an SplFileInfo as it used to return. If you instead use: flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO; this will at least keep the current behavior of a SplFileInfo class being returned. Perhaps the better course of action would be to correct the documentation rather than the behavior? People upgrading from 5.2.5 to 5.2.6 will have a nasty shock if they relied upon the default constructor parameters, and even if it is reverted in 5.2.x and kept in 5.3.x, the same problem holds. In other words, the best fix for this is to change the default value of $flags in the documentation of the constructor, not to change the behavior to match faulty docs. This is especially true since the value of the constant CURRENT_AS_FILEINFO was (incorrectly) set to 0 in the SPL module startup instead of the expected value - technically, the documentation (which says $flags = 0) is really saying $flags = CURRENT_AS_FILEINFO|KEY_AS_PATHNAME because it wasn't until this commit (http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.146&r2=1.147) that you changed those values to non-zero. The fact that the constant was changed to the actual expected/documented value does not change the fact that it's not a good reason to break BC. Greg