3v4l.org

run code in 200+ PHP versions simultaneously
<?php $element = new DOMText(" Summary for Test DOMText & with a nbsp char right here&nbsp;."); var_dump($element->textContent); $element->textContent = ltrim(" Summary for Test DOMText & with a nbsp char right here&nbsp;."); var_dump($element->textContent);
Output for 5.6.14 - 7.4.0
string(63) " Summary for Test DOMText & with a nbsp char right here&nbsp;." string(61) "Summary for Test DOMText & with a nbsp char right here&nbsp;."
Output for 5.6.1 - 5.6.13
string(63) " Summary for Test DOMText & with a nbsp char right here&nbsp;." string(69) "Summary for Test DOMText &amp; with a nbsp char right here&amp;nbsp;."
Output for 5.0.0 - 5.6.0
string(63) " Summary for Test DOMText & with a nbsp char right here&nbsp;." string(63) " Summary for Test DOMText & with a nbsp char right here&nbsp;."
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domtext in /in/lbeVg on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domtext in /in/lbeVg on line 3