diff --git a/packages/block-serialization-default-parser/class-wp-block-parser.php b/packages/block-serialization-default-parser/class-wp-block-parser.php index 5790e97f8cf29..543f53691ccb1 100644 --- a/packages/block-serialization-default-parser/class-wp-block-parser.php +++ b/packages/block-serialization-default-parser/class-wp-block-parser.php @@ -48,14 +48,6 @@ class WP_Block_Parser { */ public $stack; - /** - * Empty associative array, here due to PHP quirks - * - * @since 4.4.0 - * @var array empty associative array - */ - public $empty_attrs; - /** * Parses a document and returns a list of block structures * @@ -69,11 +61,10 @@ class WP_Block_Parser { * @return array[] */ public function parse( $document ) { - $this->document = $document; - $this->offset = 0; - $this->output = array(); - $this->stack = array(); - $this->empty_attrs = array(); + $this->document = $document; + $this->offset = 0; + $this->output = array(); + $this->stack = array(); while ( $this->proceed() ) { continue; @@ -287,7 +278,7 @@ public function next_token() { */ $attrs = $has_attrs ? json_decode( $matches['attrs'][0], /* as-associative */ true ) - : $this->empty_attrs; + : array(); /* * This state isn't allowed @@ -318,7 +309,7 @@ public function next_token() { * @return WP_Block_Parser_Block freeform block object. */ public function freeform( $inner_html ) { - return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $inner_html, array( $inner_html ) ); + return new WP_Block_Parser_Block( null, array(), array(), $inner_html, array( $inner_html ) ); } /**