throw new \ParseError('I mess everything up! :trollface:');
?>
--EXPECTF--
-Fatal error: I mess everything up! :trollface: in %sbug69640.php on line 2
+Parse error: I mess everything up! :trollface: in %sbug69640.php on line 2
return;
}
- zend_throw_exception(zend_ce_parse_error, error, E_PARSE);
+ zend_throw_exception(zend_ce_parse_error, error, 0);
}
/* }}} */
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
- zend_throw_exception(zend_ce_type_error, message, E_ERROR);
+ zend_throw_exception(zend_ce_type_error, message, 0);
efree(message);
va_end(va);
} /* }}} */
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
if (throw_exception) {
- zend_throw_exception(zend_ce_type_error, message, E_ERROR);
+ zend_throw_exception(zend_ce_type_error, message, 0);
} else {
zend_error(E_WARNING, message);
}
zend_string *message = zval_get_string(GET_PROPERTY(&exception, "message"));
zend_string *file = zval_get_string(GET_PROPERTY_SILENT(&exception, "file"));
zend_long line = zval_get_long(GET_PROPERTY_SILENT(&exception, "line"));
- zend_long code = zval_get_long(GET_PROPERTY_SILENT(&exception, "code"));
- zend_error_helper(code? code : E_ERROR, ZSTR_VAL(file), line, "%s", ZSTR_VAL(message));
+ zend_error_helper(E_PARSE, ZSTR_VAL(file), line, "%s", ZSTR_VAL(message));
zend_string_release(file);
zend_string_release(message);
if (!valid) {
zend_throw_exception(zend_ce_parse_error,
- "Invalid UTF-8 codepoint escape sequence", E_PARSE);
+ "Invalid UTF-8 codepoint escape sequence", 0);
zval_ptr_dtor(zendlval);
return FAILURE;
}
/* per RFC 3629, UTF-8 can only represent 21 bits */
if (codepoint > 0x10FFFF || errno) {
zend_throw_exception(zend_ce_parse_error,
- "Invalid UTF-8 codepoint escape sequence: Codepoint too large", E_PARSE);
+ "Invalid UTF-8 codepoint escape sequence: Codepoint too large", 0);
zval_ptr_dtor(zendlval);
return FAILURE;
}
* Because the lexing itself doesn't do that for us
*/
if (end != yytext + yyleng) {
- zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
+ zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", 0);
RETURN_TOKEN(T_ERROR);
}
} else {
/* Also not an assert for the same reason */
if (end != yytext + yyleng) {
zend_throw_exception(zend_ce_parse_error,
- "Invalid numeric literal", E_PARSE);
+ "Invalid numeric literal", 0);
RETURN_TOKEN(T_ERROR);
}
ZEND_ASSERT(!errno);
}
/* Also not an assert for the same reason */
if (end != yytext + yyleng) {
- zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
+ zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", 0);
RETURN_TOKEN(T_ERROR);
}
}
if (!valid) {
zend_throw_exception(zend_ce_parse_error,
- "Invalid UTF-8 codepoint escape sequence", E_PARSE);
+ "Invalid UTF-8 codepoint escape sequence", 0);
zval_ptr_dtor(zendlval);
return FAILURE;
}
/* per RFC 3629, UTF-8 can only represent 21 bits */
if (codepoint > 0x10FFFF || errno) {
zend_throw_exception(zend_ce_parse_error,
- "Invalid UTF-8 codepoint escape sequence: Codepoint too large", E_PARSE);
+ "Invalid UTF-8 codepoint escape sequence: Codepoint too large", 0);
zval_ptr_dtor(zendlval);
return FAILURE;
}
* Because the lexing itself doesn't do that for us
*/
if (end != yytext + yyleng) {
- zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
+ zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", 0);
RETURN_TOKEN(T_ERROR);
}
} else {
/* Also not an assert for the same reason */
if (end != yytext + yyleng) {
zend_throw_exception(zend_ce_parse_error,
- "Invalid numeric literal", E_PARSE);
+ "Invalid numeric literal", 0);
RETURN_TOKEN(T_ERROR);
}
ZEND_ASSERT(!errno);
}
/* Also not an assert for the same reason */
if (end != yytext + yyleng) {
- zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
+ zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", 0);
RETURN_TOKEN(T_ERROR);
}
}
?>
--EXPECTF--
---> Type hints with callback function:
-1: Argument 1 passed to f1() must be an instance of A, integer given%s(%d)
+0: Argument 1 passed to f1() must be an instance of A, integer given%s(%d)
in f1;
-1: Argument 1 passed to f2() must be an instance of A, integer given%s(%d)
+0: Argument 1 passed to f2() must be an instance of A, integer given%s(%d)
in f2;
in f2;
---> Type hints with callback static method:
-1: Argument 1 passed to C::f1() must be an instance of A, integer given%s(%d)
+0: Argument 1 passed to C::f1() must be an instance of A, integer given%s(%d)
in C::f1 (static);
-1: Argument 1 passed to C::f2() must be an instance of A, integer given%s(%d)
+0: Argument 1 passed to C::f2() must be an instance of A, integer given%s(%d)
in C::f2 (static);
in C::f2 (static);
---> Type hints with callback instance method:
-1: Argument 1 passed to D::f1() must be an instance of A, integer given%s(%d)
+0: Argument 1 passed to D::f1() must be an instance of A, integer given%s(%d)
in C::f1 (instance);
-1: Argument 1 passed to D::f2() must be an instance of A, integer given%s(%d)
+0: Argument 1 passed to D::f2() must be an instance of A, integer given%s(%d)
in C::f2 (instance);
in C::f2 (instance);