From: Nikita Popov Date: Mon, 12 May 2014 18:44:30 +0000 (+0200) Subject: Fix spl_directory cast_object, reenable error X-Git-Tag: POST_PHPNG_MERGE~380^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8904f72d7c47253345f7039afd8ca754442c7e34;p=php Fix spl_directory cast_object, reenable error --- diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 0007e98e67..52689d2d6a 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -115,8 +115,7 @@ again: break; } - // TODO: The following line breakes phar ??? - // zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val); + zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val); } else if (Z_OBJ_HT_P(op)->get) { zval rv; zval *tmp = Z_OBJ_HT_P(op)->get(op, &rv TSRMLS_CC); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 8cc7ec0b6d..f7a1de4c07 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1881,6 +1881,9 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS } return SUCCESS; } + } else if (type == _IS_BOOL) { + ZVAL_TRUE(writeobj); + return SUCCESS; } if (readobj == writeobj) { zval_dtor(readobj);