DomNode::add_namespace

(PHP 4 >= 4.3.0)

DomNode::add_namespace Adds a namespace declaration to a node

Описание

bool DOMNode::add_namespace ( string $uri , string $prefix )

This method adds a namespace declaration to a node.

Замечание:

This method is not part of the DOM specification.

Список параметров

uri

The namespace URI of the node.

prefix

The namespace prefix of the node.

Возвращаемые значения

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Migrating to PHP 5

You can set the namespace URI and prefix of a DOMElement or a DOMAttr at creation time by using DOMDocument::createElementNS or DOMDocument::createAttributeNS.

Замечание:

Remember the an attribute does not inherit its namespace from the element it is attached to.

[an error occurred while processing the directive]

Коментарии

Integer overflow for 64 bit platform

If PHP encounters a number beyond the bounds of the integer type, it will be interpreted as a float.
This above general rule differs depending on whether a 32 bit or 64 bit platform is used, which is described as follows.

Platform:32 bit,Range: -2^31-1 to 2^31-1,Numbers:-2147483647 to 2147483647
Platform:64 bit,Range: -2^63-1 and 2^63 -1,Numbers:-9223372036854775807 to 9223372036854775807
 

<?php
$large_number
=9223372036854775807;
var_dump($large_number);
// output: int(9223372036854775807)
$large_number 9223372036854775808;
var_dump($large_number);
// output: float(9.2233720368548E+18) as 9223372036854775808

//2^64-1 is 18446744073709551615
var_dump(0xffffffffffffffff);
// output: float(1.844674407371E+19) as 18446744073709551615
?>
2009-03-19 00:01:31
http://php5.kiev.ua/manual/ru/function.domnode-add-namespace.html

    Поддержать сайт на родительском проекте КГБ