Last active
July 6, 2021 11:00
-
-
Save axiac/e2282b97e7ba34c30b39 to your computer and use it in GitHub Desktop.
A PHP bug reported in 2011: https://bugs.php.net/bug.php?id=55701. Four years and four versions later, the bug is still there, affecting versions 5.3, 5.4, 5.5, 5.6 and 7.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL & ~E_NOTICE); | |
ini_set('display_errors', '1'); | |
$glob = new GlobIterator(__DIR__.'/*.some-funky-termination-that-doesnt-match-any-file-in-this-directory'); | |
echo('Number of matching files: '.$glob->count()."\n"); | |
// It should display the above message with 0 files but it throws a confusing exception: | |
// LogicException: The parent constructor was not called: the object is in an invalid state | |
// Any method you call on $glob throws the same exception. | |
// This is the end of file; no closing PHP tag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It has been fixed in v5.6.24.