mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Ensure Exception::getFile/getLine return type is correct
These return an untyped protected property, so we can't rely on the type being correct. Also add return types to the interface -- normally this would be a no-go, but Throwable is a special interface that can only be implemented internally, so we control all implementations.
This commit is contained in:
parent
d579e1809a
commit
70b2aa7fb8
3 changed files with 38 additions and 46 deletions
|
@ -380,8 +380,7 @@ ZEND_METHOD(Exception, getFile)
|
|||
ZEND_PARSE_PARAMETERS_NONE();
|
||||
|
||||
prop = GET_PROPERTY(ZEND_THIS, ZEND_STR_FILE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
RETURN_STR(zval_get_string(prop));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -394,8 +393,7 @@ ZEND_METHOD(Exception, getLine)
|
|||
ZEND_PARSE_PARAMETERS_NONE();
|
||||
|
||||
prop = GET_PROPERTY(ZEND_THIS, ZEND_STR_LINE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
RETURN_LONG(zval_get_long(prop));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue