zval norm1, norm2;
zval *num1_p = NULL, *num2_p = NULL;
zval *norm1_p = NULL, *norm2_p = NULL;
- zval* str1_p = collator_convert_object_to_string( op1, &str1 );
- zval* str2_p = collator_convert_object_to_string( op2, &str2 );
+ zval *str1_p, *str2_p;
+
+ ZVAL_NULL(&str1);
+ str1_p = collator_convert_object_to_string( op1, &str1 );
+ ZVAL_NULL(&str2);
+ str2_p = collator_convert_object_to_string( op2, &str2 );
/* If both args are strings AND either of args is not numeric string
* then use ICU-compare. Otherwise PHP-compare. */
--- /dev/null
+--TEST--
+Bug #75193 segfault in collator_convert_object_to_string
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+$a = new \Collator('en_US');
+$b = [new stdclass, new stdclass];
+var_dump($a->sort($b));
+?>
+===DONE===
+--EXPECT--
+bool(true)
+===DONE===