See propsed fix results
Speed comparison
 TestAttributesContentResult
1[test id="1"]content[/test]array(1) { ["id"]=> string(1) "1" } string(7) "content" <a href="#1">content</a>
2[test id="1"/]array(1) { ["id"]=> string(1) "1" } NULL <a href="#1"></a>
3[test id="1" /]array(1) { ["id"]=> string(1) "1" } NULL <a href="#1"></a>
4[test id="1"/] and then [test id="2"]content[/test]array(1) { ["id"]=> string(1) "1" } string(30) " and then [test id="2"]content" <a href="#1"> and then [test id="2"]content</a>
5[test id="1" /] and then [test id="2"]content[/test]array(1) { ["id"]=> string(1) "1" } string(30) " and then [test id="2"]content" <a href="#1"> and then [test id="2"]content</a>
6[test/] and then [test id="2"]content[/test]string(0) "" string(30) " and then [test id="2"]content" <a href="#"> and then [test id="2"]content</a>
7[test /] and then [test id="2"]content[/test]string(0) "" string(30) " and then [test id="2"]content" <a href="#"> and then [test id="2"]content</a>