+ /**
+ * Lazy-loading callback to get canonical ParserOutput object
+ *
+ * @var callable
+ */
+ public $parserOutputCallback;
+
+ /**
+ * @return ParserOutput Canonical parser output
+ */
+ public function getOutput() {
+ if ( !$this->canonicalOutput ) {
+ $this->canonicalOutput = call_user_func( $this->parserOutputCallback );
+ }
+
+ return $this->canonicalOutput;
+ }
+
+ /**
+ * Fetch the ParserOutput via a lazy-loaded callback (for backwards compatibility).
+ *
+ * @deprecated since 1.33
+ * @param string $name
+ * @return mixed
+ */
+ function __get( $name ) {
+ if ( $name === 'output' ) {
+ return $this->getOutput();
+ }
+
+ throw new RuntimeException( "Undefined field $name." );
+ }