WordPress at a glance
function is not described

wc_shipping_methods_have_changed() WC 3.2.0

See if the methods have changed since the last request.

No Hooks.

Return

true|false. Nothing.

Usage

wc_shipping_methods_have_changed( $key, $package );
$key(int) (required)
Key of package.
$package(array) (required)
Package data array.

Changelog

Since 3.2.0 Introduced.

Code of wc_shipping_methods_have_changed() WC 5.3.0

<?php
function wc_shipping_methods_have_changed( $key, $package ) {
	// Lookup previous methods from session.
	$previous_shipping_methods = WC()->session->get( 'previous_shipping_methods' );
	// Get new and old rates.
	$new_rates  = array_keys( $package['rates'] );
	$prev_rates = isset( $previous_shipping_methods[ $key ] ) ? $previous_shipping_methods[ $key ] : false;
	// Update session.
	$previous_shipping_methods[ $key ] = $new_rates;
	WC()->session->set( 'previous_shipping_methods', $previous_shipping_methods );
	return $new_rates !== $prev_rates;
}