+static inline int php_ion_symbol_zval_compare(zval *zv1, zval *zv2) {
+ zend_string *zs1 = zval_get_string(zv1);
+ zend_string *zs2 = zval_get_string(zv2);
+
+ if (EG(exception)) {
+ return 0;
+ }
+
+ int result;
+ if (zs1->len > zs2->len) {
+ result = 1;
+ } else if (zs2->len > zs1->len) {
+ result = -1;
+ } else {
+ result = memcmp(zs1->val, zs2->val, zs1->len);
+ }
+ zend_string_release(zs1);
+ zend_string_release(zs2);
+ return result;
+}
+