Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment about mb_detect_encoding performance #186

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Dom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ public function __construct($version = '', $encoding = null)
/**
* Named constructor to provide convenient way of transforming HTML into DOM.
*
* Due to slow automatic encoding detection, we recommend passing it ether in meta charset or in $options.
schlessera marked this conversation as resolved.
Show resolved Hide resolved
*
* @param string $html HTML to turn into a DOM.
* @param array|string $options Optional. Array of options to configure the document. Used as encoding if a string
* is passed. Defaults to an empty array.
Expand Down Expand Up @@ -377,6 +379,7 @@ public static function fromHtml($html, $options = [])
* Named constructor to provide convenient way of transforming a HTML fragment into DOM.
*
* The difference to Document::fromHtml() is that fragments are not normalized as to their structure.
* Due to slow automatic encoding detection, we recommend passing it in $options.
schlessera marked this conversation as resolved.
Show resolved Hide resolved
*
* @param string $html HTML to turn into a DOM.
* @param array|string $options Optional. Array of options to configure the document. Used as encoding if a string
Expand Down