Skip to content

Commit 8904f72

Browse files
committed
Fix spl_directory cast_object, reenable error
1 parent f29b683 commit 8904f72

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Zend/zend_execute.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
115115
break;
116116
}
117117

118-
// TODO: The following line breakes phar ???
119-
// zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val);
118+
zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val);
120119
} else if (Z_OBJ_HT_P(op)->get) {
121120
zval rv;
122121
zval *tmp = Z_OBJ_HT_P(op)->get(op, &rv TSRMLS_CC);

ext/spl/spl_directory.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,9 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS
18811881
}
18821882
return SUCCESS;
18831883
}
1884+
} else if (type == _IS_BOOL) {
1885+
ZVAL_TRUE(writeobj);
1886+
return SUCCESS;
18841887
}
18851888
if (readobj == writeobj) {
18861889
zval_dtor(readobj);

0 commit comments

Comments
 (0)