+ /**
+ * @param ParserOptions $other
+ * @return bool Whether the cache key relevant options match those of $other
+ * @since 1.33
+ */
+ public function matchesForCacheKey( ParserOptions $other ) {
+ foreach ( self::allCacheVaryingOptions() as $option ) {
+ // Populate any lazy options
+ $this->lazyLoadOption( $option );
+ $other->lazyLoadOption( $option );
+
+ $o1 = $this->optionToString( $this->options[$option] );
+ $o2 = $this->optionToString( $other->options[$option] );
+ if ( $o1 !== $o2 ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+