????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 216.73.216.238 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/simplexml/tests/ |
Upload File : |
--TEST-- SimpleXML: var_dump() --SKIPIF-- <?php if (!extension_loaded("simplexml")) print "skip"; ?> --FILE-- <?php $sxe = simplexml_load_file(dirname(__FILE__).'/000.xml'); function test($what) { global $sxe; echo "===$what\n"; eval("var_dump(isset(\$$what));"); eval("var_dump((bool)\$$what);"); eval("var_dump(count(\$$what));"); eval("var_dump(\$$what);"); } test('sxe'); test('sxe->elem1'); test('sxe->elem1[0]'); test('sxe->elem1[0]->elem2'); test('sxe->elem1[0]->elem2->bla'); if (!ini_get("unicode_semantics")) test('sxe->elem1[0]["attr1"]'); test('sxe->elem1[0]->attr1'); test('sxe->elem1[1]'); test('sxe->elem1[2]'); test('sxe->elem11'); test('sxe->elem11->elem111'); test('sxe->elem11->elem111->elem1111'); test('sxe->elem22'); test('sxe->elem22->elem222'); test('sxe->elem22->attr22'); test('sxe->elem22["attr22"]'); ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- ===sxe bool(true) bool(true) int(3) object(SimpleXMLElement)#%d (3) { ["@attributes"]=> array(1) { ["id"]=> string(3) "123" } ["elem1"]=> array(2) { [0]=> string(36) "There is some text.Here is some more" [1]=> object(SimpleXMLElement)#%d (1) { ["@attributes"]=> array(2) { ["attr1"]=> string(2) "11" ["attr2"]=> string(2) "12" } } } ["elem11"]=> object(SimpleXMLElement)#%d (1) { ["elem111"]=> object(SimpleXMLElement)#%d (1) { ["elem1111"]=> object(SimpleXMLElement)#%d (0) { } } } } ===sxe->elem1 bool(true) bool(true) int(2) object(SimpleXMLElement)#%d (3) { ["@attributes"]=> array(2) { ["attr1"]=> string(5) "first" ["attr2"]=> string(6) "second" } ["comment"]=> object(SimpleXMLElement)#%d (0) { } ["elem2"]=> object(SimpleXMLElement)#%d (2) { ["@attributes"]=> array(2) { ["att25"]=> string(2) "25" ["att42"]=> string(2) "42" } ["elem3"]=> object(SimpleXMLElement)#%d (1) { ["elem4"]=> object(SimpleXMLElement)#%d (1) { ["test"]=> object(SimpleXMLElement)#%d (0) { } } } } } ===sxe->elem1[0] bool(true) bool(true) int(1) object(SimpleXMLElement)#%d (3) { ["@attributes"]=> array(2) { ["attr1"]=> string(5) "first" ["attr2"]=> string(6) "second" } ["comment"]=> object(SimpleXMLElement)#%d (0) { } ["elem2"]=> object(SimpleXMLElement)#%d (2) { ["@attributes"]=> array(2) { ["att25"]=> string(2) "25" ["att42"]=> string(2) "42" } ["elem3"]=> object(SimpleXMLElement)#%d (1) { ["elem4"]=> object(SimpleXMLElement)#%d (1) { ["test"]=> object(SimpleXMLElement)#%d (0) { } } } } } ===sxe->elem1[0]->elem2 bool(true) bool(true) int(1) object(SimpleXMLElement)#%d (2) { ["@attributes"]=> array(2) { ["att25"]=> string(2) "25" ["att42"]=> string(2) "42" } ["elem3"]=> object(SimpleXMLElement)#%d (1) { ["elem4"]=> object(SimpleXMLElement)#%d (1) { ["test"]=> object(SimpleXMLElement)#%d (0) { } } } } ===sxe->elem1[0]->elem2->bla bool(false) bool(false) int(0) object(SimpleXMLElement)#%d (0) { } ===sxe->elem1[0]["attr1"] bool(true) bool(true) int(0) object(SimpleXMLElement)#%d (1) { [0]=> string(5) "first" } ===sxe->elem1[0]->attr1 bool(false) bool(false) int(0) object(SimpleXMLElement)#%d (0) { } ===sxe->elem1[1] bool(true) bool(true) int(0) object(SimpleXMLElement)#%d (1) { ["@attributes"]=> array(2) { ["attr1"]=> string(2) "11" ["attr2"]=> string(2) "12" } } ===sxe->elem1[2] bool(false) bool(false) int(0) NULL ===sxe->elem11 bool(true) bool(true) int(1) object(SimpleXMLElement)#%d (1) { ["elem111"]=> object(SimpleXMLElement)#%d (1) { ["elem1111"]=> object(SimpleXMLElement)#%d (0) { } } } ===sxe->elem11->elem111 bool(true) bool(true) int(1) object(SimpleXMLElement)#%d (1) { ["elem1111"]=> object(SimpleXMLElement)#%d (0) { } } ===sxe->elem11->elem111->elem1111 bool(true) bool(true) int(1) object(SimpleXMLElement)#%d (0) { } ===sxe->elem22 bool(false) bool(false) int(0) object(SimpleXMLElement)#%d (0) { } ===sxe->elem22->elem222 bool(false) bool(false) int(0) NULL ===sxe->elem22->attr22 bool(false) bool(false) int(0) NULL ===sxe->elem22["attr22"] bool(false) bool(false) int(0) NULL ===DONE===