@@ -465,30 +465,30 @@ static zend_always_inline bool simdjson_validate_encode_depth(const zend_long de
465
465
466
466
#if PHP_VERSION_ID >= 80200
467
467
/* * For simple types we can just return direct interned string without allocating new strings */
468
- static zend_always_inline bool simdjson_encode_simple (const zval *parameter, zval *return_value, zend_long options ) {
468
+ static zend_always_inline bool simdjson_encode_simple (const zval *parameter, zval *return_value) {
469
469
switch (Z_TYPE_P (parameter)) {
470
470
case IS_NULL:
471
- RETVAL_STR (ZSTR_KNOWN (ZEND_STR_NULL_LOWERCASE));
471
+ RETVAL_INTERNED_STR (ZSTR_KNOWN (ZEND_STR_NULL_LOWERCASE));
472
472
return true ;
473
473
474
474
case IS_TRUE:
475
- RETVAL_STR (ZSTR_KNOWN (ZEND_STR_TRUE));
475
+ RETVAL_INTERNED_STR (ZSTR_KNOWN (ZEND_STR_TRUE));
476
476
return true ;
477
477
478
478
case IS_FALSE:
479
- RETVAL_STR (ZSTR_KNOWN (ZEND_STR_FALSE));
479
+ RETVAL_INTERNED_STR (ZSTR_KNOWN (ZEND_STR_FALSE));
480
480
return true ;
481
481
482
482
case IS_LONG:
483
483
if (Z_LVAL_P (parameter) >= 0 && Z_LVAL_P (parameter) < 10 ) {
484
- RETVAL_STR (ZSTR_CHAR ((unsigned char ) ' 0' + Z_LVAL_P (parameter)));
484
+ RETVAL_INTERNED_STR (ZSTR_CHAR ((unsigned char ) ' 0' + Z_LVAL_P (parameter)));
485
485
return true ;
486
486
}
487
487
break ;
488
488
489
489
case IS_ARRAY:
490
490
if (zend_hash_num_elements (Z_ARRVAL_P (parameter)) == 0 ) {
491
- RETVAL_STR (simdjson_json_empty_array);
491
+ RETVAL_INTERNED_STR (simdjson_json_empty_array);
492
492
return true ;
493
493
}
494
494
break ;
@@ -517,7 +517,7 @@ PHP_FUNCTION(simdjson_encode) {
517
517
}
518
518
519
519
#if PHP_VERSION_ID >= 80200
520
- if (!(options & SIMDJSON_APPEND_NEWLINE) && simdjson_encode_simple (parameter, return_value, options )) {
520
+ if (!(options & SIMDJSON_APPEND_NEWLINE) && simdjson_encode_simple (parameter, return_value)) {
521
521
return ;
522
522
}
523
523
#endif
0 commit comments