@@ -411,7 +411,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
411
411
* and could also be E_PARSE, but we use this only during parsing
412
412
* and this is during runtime.
413
413
*/
414
- zend_throw_error (NULL , "Cannot create unnamed attribute" );
414
+ zend_throw_error (NULL , "Cannot append to an attribute list " );
415
415
return & EG (error_zval );
416
416
}
417
417
goto long_dim ;
@@ -436,7 +436,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
436
436
}
437
437
438
438
if (!Z_STRLEN_P (member )) {
439
- php_error_docref ( NULL , E_WARNING , "Cannot write or create unnamed %s " , attribs ? "attribute" : "element" );
439
+ zend_value_error ( "Cannot create %s with an empty name " , attribs ? "attribute" : "element" );
440
440
if (member == & tmp_zv ) {
441
441
zval_ptr_dtor_str (& tmp_zv );
442
442
}
@@ -464,7 +464,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
464
464
* and could also be E_PARSE, but we use this only during parsing
465
465
* and this is during runtime.
466
466
*/
467
- zend_throw_error ( NULL , "Cannot create unnamed attribute" );
467
+ zend_value_error ( "Cannot append to an attribute list " );
468
468
return & EG (error_zval );
469
469
}
470
470
if (attribs && !node && sxe -> iter .type == SXE_ITER_ELEMENT ) {
@@ -489,8 +489,8 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
489
489
if (Z_OBJCE_P (value ) == sxe_class_entry ) {
490
490
zval zval_copy ;
491
491
if (sxe_object_cast_ex (Z_OBJ_P (value ), & zval_copy , IS_STRING ) == FAILURE ) {
492
- zend_error ( E_ERROR , "Unable to cast node to string" );
493
- /* FIXME: Should not be fatal */
492
+ zend_throw_error ( NULL , "Unable to cast node to string" );
493
+ return & EG ( error_zval );
494
494
}
495
495
496
496
value_str = Z_STR (zval_copy );
@@ -501,7 +501,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value,
501
501
if (member == & tmp_zv ) {
502
502
zval_ptr_dtor_str (& tmp_zv );
503
503
}
504
- zend_error ( E_WARNING , "It is not yet possible to assign complex types to %s" , attribs ? "attributes" : "properties" );
504
+ zend_type_error ( "It's not possible to assign a complex type to %s, %s given " , attribs ? "attributes" : "properties" , zend_zval_type_name ( value ) );
505
505
return & EG (error_zval );
506
506
}
507
507
}
@@ -656,7 +656,7 @@ static zval *sxe_property_get_adr(zend_object *object, zend_string *zname, int f
656
656
}
657
657
ZVAL_STR (& member , zname );
658
658
if (sxe_prop_dim_write (object , & member , NULL , 1 , 0 , & node ) == & EG (error_zval )) {
659
- return NULL ;
659
+ return & EG ( error_zval ) ;
660
660
}
661
661
type = SXE_ITER_NONE ;
662
662
name = NULL ;
@@ -1684,8 +1684,8 @@ SXE_METHOD(addChild)
1684
1684
}
1685
1685
1686
1686
if (qname_len == 0 ) {
1687
- php_error_docref ( NULL , E_WARNING , "Element name is required " );
1688
- return ;
1687
+ zend_argument_value_error ( 1 , "cannot be empty " );
1688
+ RETURN_THROWS () ;
1689
1689
}
1690
1690
1691
1691
sxe = Z_SXEOBJ_P (ZEND_THIS );
@@ -1749,8 +1749,8 @@ SXE_METHOD(addAttribute)
1749
1749
}
1750
1750
1751
1751
if (qname_len == 0 ) {
1752
- php_error_docref ( NULL , E_WARNING , "Attribute name is required " );
1753
- return ;
1752
+ zend_argument_value_error ( 1 , "cannot be empty " );
1753
+ RETURN_THROWS () ;
1754
1754
}
1755
1755
1756
1756
sxe = Z_SXEOBJ_P (ZEND_THIS );
@@ -2274,8 +2274,8 @@ PHP_FUNCTION(simplexml_load_file)
2274
2274
}
2275
2275
2276
2276
if (ZEND_LONG_EXCEEDS_INT (options )) {
2277
- php_error_docref ( NULL , E_WARNING , "Invalid options " );
2278
- RETURN_FALSE ;
2277
+ zend_argument_value_error ( 3 , "is too large " );
2278
+ RETURN_THROWS () ;
2279
2279
}
2280
2280
2281
2281
docp = xmlReadFile (filename , NULL , (int )options );
@@ -2319,16 +2319,16 @@ PHP_FUNCTION(simplexml_load_string)
2319
2319
}
2320
2320
2321
2321
if (ZEND_SIZE_T_INT_OVFL (data_len )) {
2322
- php_error_docref ( NULL , E_WARNING , "Data is too long" );
2323
- RETURN_FALSE ;
2322
+ zend_argument_value_error ( 1 , " is too long" );
2323
+ RETURN_THROWS () ;
2324
2324
}
2325
2325
if (ZEND_SIZE_T_INT_OVFL (ns_len )) {
2326
- php_error_docref ( NULL , E_WARNING , "Namespace is too long" );
2327
- RETURN_FALSE ;
2326
+ zend_argument_value_error ( 4 , " is too long" );
2327
+ RETURN_THROWS () ;
2328
2328
}
2329
2329
if (ZEND_LONG_EXCEEDS_INT (options )) {
2330
- php_error_docref ( NULL , E_WARNING , "Invalid options " );
2331
- RETURN_FALSE ;
2330
+ zend_argument_value_error ( 3 , "is too large " );
2331
+ RETURN_THROWS () ;
2332
2332
}
2333
2333
2334
2334
docp = xmlReadMemory (data , (int )data_len , NULL , NULL , (int )options );
0 commit comments