mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fixed #65213 - cannot cast SplFileInfo to boolean
This commit is contained in:
commit
52b41f24e3
@ -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);
|
||||
|
13
ext/spl/tests/bug65213.phpt
Normal file
13
ext/spl/tests/bug65213.phpt
Normal file
@ -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===
|
Loading…
Reference in New Issue
Block a user