diff options
author | Tjerk Meesters <datibbaw@php.net> | 2014-12-04 07:18:33 +0800 |
---|---|---|
committer | Tjerk Meesters <datibbaw@php.net> | 2014-12-04 07:21:13 +0800 |
commit | 52b41f24e32c2c3f503a90e4f9879babc945c8e7 (patch) | |
tree | e52e1d2d8800244b15ee510ea55e73b7a760afc1 | |
parent | 5deac25ea033cf6a5ece410789aa080cbdc41573 (diff) | |
parent | 2bcf8a6cd921486f0ee4835166984ecf4f0b2021 (diff) | |
download | php-git-52b41f24e32c2c3f503a90e4f9879babc945c8e7.tar.gz |
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
Fixed #65213 - cannot cast SplFileInfo to boolean
-rw-r--r-- | ext/spl/spl_directory.c | 3 | ||||
-rw-r--r-- | ext/spl/tests/bug65213.phpt | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 2875cc2e74..4437ca8749 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1907,6 +1907,9 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS } return SUCCESS; } + } else if (type == IS_BOOL) { + ZVAL_BOOL(writeobj, 1); + return SUCCESS; } if (readobj == writeobj) { zval_dtor(readobj); diff --git a/ext/spl/tests/bug65213.phpt b/ext/spl/tests/bug65213.phpt new file mode 100644 index 0000000000..5e34d9549c --- /dev/null +++ b/ext/spl/tests/bug65213.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #65213 (cannot cast SplFileInfo to boolean) +--FILE-- +<?php + +$o = new SplFileInfo('.'); +var_dump((bool) $o); + +?> +===DONE=== +--EXPECT-- +bool(true) +===DONE=== |