PHP 8.5.0 Beta 1 available for testing

Voting

: zero plus zero?
(Example: nine)

The Note You're Voting On

chris AT cmbuckley DOT co DOT uk
16 years ago
Note that the NUL character "\0" is not in the list of invalid characters for $name, so no error is triggered, but the tag name will be truncated at the null byte:

<?php

$dom
= new DOMDocument('1.0', 'utf-8');
$el = $dom->createElement('foo' . "\0" . 'bar', 'Hello World');
echo
$el->tagName; // outputs "foo"

?>

<< Back to user notes page

To Top