#include "ext/standard/php_math.h"
#include "php_date.h"
#include "zend_interfaces.h"
-#include "zend_exceptions.h"
#include "lib/timelib.h"
#include <time.h>
php_date_instantiate(date_ce_date, return_value);
dateobj = Z_PHPDATE_P(return_value);
if (!php_date_initialize_from_hash(&dateobj, myht)) {
- php_error(E_ERROR, "Invalid serialization data for DateTime object");
+ zend_throw_error(NULL, "Invalid serialization data for DateTime object");
}
}
/* }}} */
php_date_instantiate(date_ce_immutable, return_value);
dateobj = Z_PHPDATE_P(return_value);
if (!php_date_initialize_from_hash(&dateobj, myht)) {
- php_error(E_ERROR, "Invalid serialization data for DateTimeImmutable object");
+ zend_throw_error(NULL, "Invalid serialization data for DateTimeImmutable object");
}
}
/* }}} */
myht = Z_OBJPROP_P(object);
if (!php_date_initialize_from_hash(&dateobj, myht)) {
- php_error(E_ERROR, "Invalid serialization data for DateTime object");
+ zend_throw_error(NULL, "Invalid serialization data for DateTime object");
}
}
/* }}} */
php_date_instantiate(date_ce_timezone, return_value);
tzobj = Z_PHPTIMEZONE_P(return_value);
if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht) != SUCCESS) {
- zend_throw_error(zend_ce_error, "Timezone initialization failed");
+ zend_throw_error(NULL, "Timezone initialization failed");
zval_dtor(return_value);
RETURN_FALSE;
}
myht = Z_OBJPROP_P(object);
if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht) != SUCCESS) {
- zend_throw_error(zend_ce_error, "Timezone initialization failed");
+ zend_throw_error(NULL, "Timezone initialization failed");
RETURN_FALSE;
}
}
object_init_ex(return_value, date_ce_period);
period_obj = Z_PHPPERIOD_P(return_value);
if (!php_date_period_initialize_from_hash(period_obj, myht)) {
- php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
+ zend_throw_error(NULL, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
myht = Z_OBJPROP_P(object);
if (!php_date_period_initialize_from_hash(period_obj, myht)) {
- php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
+ zend_throw_error(NULL, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
{
zval *zv;
if (type != BP_VAR_IS && type != BP_VAR_R) {
- zend_throw_error(zend_ce_error, "Retrieval of DatePeriod properties for modification is unsupported");
+ zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
return &EG(uninitialized_zval);
}
/* {{{ date_period_write_property */
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
- zend_throw_error(zend_ce_error, "Writing to DatePeriod properties is unsupported");
+ zend_throw_error(NULL, "Writing to DatePeriod properties is unsupported");
}
/* }}} */
?>
==DONE==
--EXPECTF--
-Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php:%d
+Stack trace:
+#0 [internal function]: DatePeriod->__wakeup()
+#1 %sbug53437_var1.php(%d): unserialize('O:10:"DatePerio...')
+#2 {main}
+ thrown in %sbug53437_var1.php on line %d
var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime);
?>
--EXPECTF--
-Fatal error: Invalid serialization data for DateTime object in %sbug55397.php on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug55397.php:%d
+Stack trace:
+#0 [internal function]: DateTime->__wakeup()
+#1 %sbug55397.php(%d): unserialize('O:8:"DateTime":...')
+#2 {main}
+ thrown in %sbug55397.php on line %d
} catch ( Exception $e ) {}
--EXPECTF--
-Fatal error: Invalid serialization data for DateTime object in %sbug62852.php on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852.php:%d
+Stack trace:
+#0 [internal function]: DateTime->__wakeup()
+#1 %sbug62852.php(%d): unserialize('O:8:"DateTime":...')
+#2 {main}
+ thrown in %sbug62852.php on line %d
var_dump( $foo );
--EXPECTF--
-Fatal error: Invalid serialization data for DateTime object in %sbug62852_var2.php on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var2.php:%d
+Stack trace:
+#0 %sbug62852_var2.php(%d): DateTime->__wakeup()
+#1 [internal function]: Foo->__wakeup()
+#2 %sbug62852_var2.php(%d): unserialize('O:3:"Foo":3:{s:...')
+#3 {main}
+ thrown in %sbug62852_var2.php on line %d
var_dump( $foo );
--EXPECTF--
-Fatal error: Invalid serialization data for DateTime object in %sbug62852_var3.php on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var3.php:%d
+Stack trace:
+#0 %sbug62852_var3.php(%d): DateTime->__wakeup()
+#1 [internal function]: Foo->__wakeup()
+#2 %sbug62852_var3.php(%d): unserialize('O:3:"Foo":3:{s:...')
+#3 {main}
+ thrown in %sbug62852_var3.php on line %d
var_dump(unserialize($y));
?>
--EXPECTF--
-Fatal error: Invalid serialization data for DateTime object in %s on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug66721.php:%d
+Stack trace:
+#0 [internal function]: DateTime->__wakeup()
+#1 %sbug66721.php(%d): unserialize('O:8:"DateTime":...')
+#2 {main}
+ thrown in %sbug66721.php on line %d
var_dump($data);
?>
--EXPECTF--
-Fatal error: Invalid serialization data for DateTime object in %s%ebug68942_2.php on line %d
+Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug68942_2.php:%d
+Stack trace:
+#0 [internal function]: DateTime->__wakeup()
+#1 %sbug68942_2.php(%d): unserialize('a:2:{i:0;O:8:"D...')
+#2 {main}
+ thrown in %sbug68942_2.php on line %d
vptr = xmlSchemaNewValidCtxt(sptr);
if (!vptr) {
xmlSchemaFree(sptr);
- php_error(E_ERROR, "Invalid Schema Validation Context");
+ zend_throw_error(NULL, "Invalid Schema Validation Context");
RETURN_FALSE;
}
vptr = xmlRelaxNGNewValidCtxt(sptr);
if (!vptr) {
xmlRelaxNGFree(sptr);
- php_error(E_ERROR, "Invalid RelaxNG Validation Context");
+ zend_throw_error(NULL, "Invalid RelaxNG Validation Context");
RETURN_FALSE;
}
RETURN_TRUE;
}
- zend_throw_error(zend_ce_error, "Class %s is not derived from %s.", ZSTR_VAL(ce->name), ZSTR_VAL(basece->name));
+ zend_throw_error(NULL, "Class %s is not derived from %s.", ZSTR_VAL(ce->name), ZSTR_VAL(basece->name));
RETURN_FALSE;
}
/* }}} */
/* {{{ dom_read_na */
static int dom_read_na(dom_object *obj, zval *retval)
{
- zend_throw_error(zend_ce_error, "Cannot read property");
+ zend_throw_error(NULL, "Cannot read property");
return FAILURE;
}
/* }}} */
/* {{{ dom_write_na */
static int dom_write_na(dom_object *obj, zval *newval)
{
- zend_throw_error(zend_ce_error, "Cannot write property");
+ zend_throw_error(NULL, "Cannot write property");
return FAILURE;
}
/* }}} */
char address[SENDBUFLEN];
if (_php_imap_address_size(addresslist) >= SENDBUFLEN) {
- zend_throw_error(zend_ce_error, "Address buffer overflow");
+ zend_throw_error(NULL, "Address buffer overflow");
return NULL;
}
address[0] = 0;
#include <unicode/uidna.h>
#include <unicode/ustring.h>
-#include "zend_exceptions.h"
#include "ext/standard/php_string.h"
#include "intl_error.h"
RETURN_FALSE;
}
if (len >= 255) {
- zend_throw_error(zend_ce_error, "ICU returned an unexpected length");
+ zend_throw_error(NULL, "ICU returned an unexpected length");
uidna_close(uts46);
zend_string_free(buffer);
RETURN_FALSE;
/* Declare 'Normalizer' class properties. */
if( !Normalizer_ce_ptr )
{
- zend_error( E_ERROR,
+ zend_throw_error( NULL,
"Normalizer: attempt to create properties "
"on a non-registered class." );
return;
"Could not clone transliterator", 0 );
err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) );
- zend_throw_error( zend_ce_error, "%s", ZSTR_VAL(err_msg) );
+ zend_throw_error( NULL, "%s", ZSTR_VAL(err_msg) );
zend_string_free( err_msg ); /* if it's changed into a warning */
/* do not destroy tempz; we need to return something */
}
#include "php.h"
#include "php_ini.h"
-#include "zend_exceptions.h"
#include <stddef.h>
oper = LDAP_MOD_REPLACE;
break;
default:
- zend_throw_error(zend_ce_error, "Unknown and uncaught modification type.");
+ zend_throw_error(NULL, "Unknown and uncaught modification type.");
RETVAL_FALSE;
efree(ldap_mods[i]);
num_mods = i;
#if HAVE_MBREGEX
-#include "zend_exceptions.h"
#include "zend_smart_str.h"
#include "ext/standard/info.h"
#include "php_mbregex.h"
if (zend_eval_stringl(ZSTR_VAL(eval_str), ZSTR_LEN(eval_str), &v, description) == FAILURE) {
efree(description);
zend_throw_error(NULL, "Failed evaluating code: %s%s", PHP_EOL, ZSTR_VAL(eval_str));
- /* zend_error() does not return in this case */
+ onig_region_free(regs, 0);
+ smart_str_free(&out_buf);
+ smart_str_free(&eval_buf);
+ RETURN_FALSE;
}
/* result of eval */
/* {{{ mysqli_read_na */
static zval *mysqli_read_na(mysqli_object *obj, zval *retval)
{
- zend_throw_error(zend_ce_error, "Cannot read property");
+ zend_throw_error(NULL, "Cannot read property");
return NULL;
}
/* }}} */
/* {{{ mysqli_write_na */
static int mysqli_write_na(mysqli_object *obj, zval *newval)
{
- zend_throw_error(zend_ce_error, "Cannot write property");
+ zend_throw_error(NULL, "Cannot write property");
return FAILURE;
}
/* }}} */
#include "php_openssl.h"
/* PHP Includes */
-#include "zend_exceptions.h"
#include "ext/standard/file.h"
#include "ext/standard/info.h"
#include "ext/standard/php_fopen_wrappers.h"
php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
return NULL;
} else if (!X509_digest(peer, mdtype, md, &n)) {
- zend_throw_error(zend_ce_error, "Could not generate signature");
+ zend_throw_error(NULL, "Could not generate signature");
return NULL;
}
intern = Z_REFLECTION_P(getThis()); \
if (intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
- zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the reflection object"); \
+ zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \
return; \
} \
if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) {
return NULL;
}
- zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the reflection object");
+ zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object");
return NULL;
}
if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr)) {
argument = Z_REFLECTION_P(class_name);
if (argument->ptr == NULL) {
- zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the argument's reflection object");
+ zend_throw_error(NULL, "Internal error: Failed to retrieve the argument's reflection object");
return;
}
class_ce = argument->ptr;
if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr)) {
argument = Z_REFLECTION_P(interface);
if (argument->ptr == NULL) {
- zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the argument's reflection object");
+ zend_throw_error(NULL, "Internal error: Failed to retrieve the argument's reflection object");
return;
}
interface_ce = argument->ptr;
return;
}
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- zend_throw_error(zend_ce_error, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
+ zend_throw_error(NULL, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
/* Bails out */
}
member_p = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset];
}
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- zend_throw_error(zend_ce_error, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
+ zend_throw_error(NULL, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
return;
}
variable_ptr = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset];
#include "php.h"
#include "php_session.h"
-#include "zend_exceptions.h"
#include "mod_user.h"
ps_module ps_mod_user = {
}
zval_ptr_dtor(&retval);
} else {
- zend_throw_error(zend_ce_error, "No session id returned by function");
+ zend_throw_error(NULL, "No session id returned by function");
return NULL;
}
if (!id) {
- zend_throw_error(zend_ce_error, "Session id must be a string");
+ zend_throw_error(NULL, "Session id must be a string");
return NULL;
}
#include "rfc1867.h"
#include "php_variables.h"
#include "php_session.h"
-#include "zend_exceptions.h"
#include "ext/standard/md5.h"
#include "ext/standard/sha1.h"
#include "ext/standard/php_var.h"
case PS_HASH_FUNC_OTHER:
if (!PS(hash_ops)) {
efree(buf);
- zend_throw_error(zend_ce_error, "Invalid session hash function");
+ zend_throw_error(NULL, "Invalid session hash function");
return NULL;
}
#endif /* HAVE_HASH_EXT */
default:
efree(buf);
- zend_throw_error(zend_ce_error, "Invalid session hash function");
+ zend_throw_error(NULL, "Invalid session hash function");
return NULL;
}
efree(buf);
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
php_session_abort();
- zend_throw_error(zend_ce_error, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ zend_throw_error(NULL, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
if (PS(use_cookies)) {
elements = 1;
} else if (!member) {
/* This happens when the user did: $sxe[]->foo = $value */
- zend_throw_error(zend_ce_error, "Cannot create unnamed attribute");
+ zend_throw_error(NULL, "Cannot create unnamed attribute");
return &EG(uninitialized_zval);
}
name = NULL;
if (!member && node && node->parent &&
node->parent->type == XML_DOCUMENT_NODE) {
/* This happens when the user did: $sxe[]->foo = $value */
- zend_throw_error(zend_ce_error, "Cannot create unnamed attribute");
+ zend_throw_error(NULL, "Cannot create unnamed attribute");
return &EG(uninitialized_zval);
}
}
* and could also be E_PARSE, but we use this only during parsing
* and this is during runtime.
*/
- zend_throw_error(zend_ce_error, "Cannot create unnamed attribute");
+ zend_throw_error(NULL, "Cannot create unnamed attribute");
return FAILURE;
}
} else {
* and could also be E_PARSE, but we use this only during parsing
* and this is during runtime.
*/
- zend_throw_error(zend_ce_error, "Cannot create unnamed attribute");
+ zend_throw_error(NULL, "Cannot create unnamed attribute");
return FAILURE;
}
if (attribs && !node && sxe->iter.type == SXE_ITER_ELEMENT) {
if (elements) {
if (!member || Z_TYPE_P(member) == IS_LONG) {
if (node->type == XML_ATTRIBUTE_NODE) {
- zend_throw_error(zend_ce_error, "Cannot create duplicate attribute");
+ zend_throw_error(NULL, "Cannot create duplicate attribute");
if (new_value) {
zval_ptr_dtor(value);
}
intern->u.dir.index = index;
break;
case SPL_FS_FILE:
- zend_throw_error(zend_ce_error, "An object of class %s cannot be cloned", ZSTR_VAL(old_object->ce->name));
+ zend_throw_error(NULL, "An object of class %s cannot be cloned", ZSTR_VAL(old_object->ce->name));
return NULL;
}
success = SUCCESS;
} else {
- zend_throw_error(zend_ce_error, "Unable to call %s::%s()", intern->inner.ce->name, method);
+ zend_throw_error(NULL, "Unable to call %s::%s()", intern->inner.ce->name, method);
success = FAILURE;
}
if (do_free) {
spl_dual_it_free(intern);
} else if (!intern->inner.iterator) {
- zend_throw_error(zend_ce_error, "The inner constructor wasn't initialized with an iterator instance");
+ zend_throw_error(NULL, "The inner constructor wasn't initialized with an iterator instance");
return;
}
intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
}
if (!EX(prev_execute_data)->func->common.scope) {
- zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active");
+ zend_throw_error(NULL, "Cannot call forward_static_call() when no class scope is active");
+ return;
}
fci.retval = &retval;
} else {
maxlen = 2 * oldlen;
if (maxlen < oldlen) {
- zend_error_noreturn(E_ERROR, "Input string is too long");
+ zend_throw_error(NULL, "Input string is too long");
return NULL;
}
}
?>
--EXPECTF--
-Fatal error: Cannot call forward_static_call() when no class scope is active in %s on line %d
+Fatal error: Uncaught Error: Cannot call forward_static_call() when no class scope is active in %s:%d
+Stack trace:
+#0 %s(%d): forward_static_call(Array)
+#1 %s(%d): test()
+#2 {main}
+ thrown in %s on line %d
#if HAVE_TIDY
#include "php_ini.h"
-#include "zend_exceptions.h"
#include "ext/standard/info.h"
#include "tidy.h"
__constructor for tidyNode. */
static TIDY_NODE_METHOD(__construct)
{
- zend_throw_error(zend_ce_error, "You should not create a tidyNode manually");
+ zend_throw_error(NULL, "You should not create a tidyNode manually");
}
/* }}} */
#endif
#include "php.h"
-#include "zend_exceptions.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "ext/date/php_date.h"
ht = HASH_OF(&val);
if (ht && ht->u.v.nApplyCount > 1) {
- zend_throw_error(zend_ce_error, "XML-RPC doesn't support circular references");
+ zend_throw_error(NULL, "XML-RPC doesn't support circular references");
return NULL;
}
#include "php.h"
#include "php_ini.h"
-#include "zend_exceptions.h"
#include "ext/standard/info.h"
#include "ext/standard/file.h"
#include "ext/standard/php_string.h"
globfree(&globbuf);
return globbuf.gl_pathc;
#else
- zend_throw_error(zend_ce_error, "Glob support is not available");
+ zend_throw_error(NULL, "Glob support is not available");
return 0;
#endif /* HAVE_GLOB */
}