<?php
$tpnb = 5;
test();
die();
function test() {
global $tpnb;
var_dump($tpnb);
$xmlStruct = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<object type="obj_1" label="Label for object 1"></object>
<object type="obj_2" label="Label for object 2"></object>
<object type="obj_3" label="Label for object 3"></object>
<object type="obj_4" label="Label for object 4"></object>
<object type="obj_5" label="Label for object 5"></object>
<object type="obj_6" label="Label for object 6"></object>
<object type="obj_7" label="Label for object 7"></object>
<object type="obj_8" label="Label for object 8"></object>
<object type="obj_9" label="Label for object 9"></object>
<object type="obj_10" label="Label for object 10"></object>
</templates>
EOF;
$tplxml = simplexml_load_string($xmlStruct);
var_dump($tplxml->object[$tpnb]);
var_dump($tplxml->object[(int) $tpnb]);
var_dump($tplxml->object[($tpnb + 1 - 1)]);
$tpnbx = $tpnb;
unset($tpnb);
$tpnb = $tpnbx;
var_dump($tplxml->object[$tpnb]);
}
- Output for 8.4.1 - 8.4.12
- int(5)
object(SimpleXMLElement)#3 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#2 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#3 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#2 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
- Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.19, 5.6.21 - 5.6.40, 7.0.10 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
- int(5)
object(SimpleXMLElement)#4 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#3 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#2 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#4 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
- Output for 7.0.0 - 7.0.9
- int(5)
NULL
object(SimpleXMLElement)#4 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#3 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
object(SimpleXMLElement)#2 (1) {
["@attributes"]=>
array(2) {
["type"]=>
string(5) "obj_6"
["label"]=>
string(18) "Label for object 6"
}
}
- Output for 5.6.20
Process exited with code 137.- Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
- int(5)
object(SimpleXMLElement)#4 (0) {
}
object(SimpleXMLElement)#3 (0) {
}
object(SimpleXMLElement)#2 (0) {
}
object(SimpleXMLElement)#4 (0) {
}
- Output for 4.4.5 - 4.4.9
- int(5)
Fatal error: Call to undefined function: simplexml_load_string() in /in/IiZvt on line 29
Process exited with code 255. - Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.4
- int(5)
Fatal error: Call to undefined function: simplexml_load_string() in /in/IiZvt on line 29
Process exited with code 255. - Output for 4.4.2
- int(5)
Fatal error: Call to undefined function: simplexml_load_string() in /in/IiZvt on line 30
Process exited with code 255. - Output for 4.3.0 - 4.3.1
- int(5)
Fatal error: Call to undefined function: simplexml_load_string() in /in/IiZvt on line 29
preferences:
151.58 ms | 417 KiB | 5 Q