File: bug01272-002.phpt

package info (click to toggle)
xdebug 3.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,096 kB
  • sloc: ansic: 19,944; php: 6,217; xml: 4,172; pascal: 534; makefile: 4; sh: 2
file content (25 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
Test for bug #1272: property_get doesn't return attributes for SimpleXMLElement
--SKIPIF--
<?php
require __DIR__ . '/../utils.inc';
check_reqs('ext simplexml');
?>
--FILE--
<?php
include dirname(__FILE__) . '/bug01272.inc';

xdebug_debug_zval('e');
xdebug_debug_zval('e->@attributes');
xdebug_debug_zval('e->@attributes["att1"]');
xdebug_debug_zval('e->b[0]->@attributes');
xdebug_debug_zval('e->b[1]->@attributes["attb"]');
?>
--EXPECTF--
attb-1
attb-2
e: (refcount=1, is_ref=0)=class SimpleXMLElement { public $@attributes = (refcount=1, is_ref=0)=array ('att1' => (refcount=1, is_ref=0)='att-a'); public $b = (refcount=1, is_ref=0)=array (0 => (refcount=1, is_ref=0)=class SimpleXMLElement { ... }, 1 => (refcount=1, is_ref=0)=class SimpleXMLElement { ... }) }
e->@attributes: (refcount=%d, is_ref=0)=array ('att1' => (refcount=1, is_ref=0)='att-a')
e->@attributes["att1"]: (refcount=%d, is_ref=0)='att-a'
e->b[0]->@attributes: (refcount=%d, is_ref=0)=array ('attb' => (refcount=1, is_ref=0)='attb-1')
e->b[1]->@attributes["attb"]: (refcount=%d, is_ref=0)='attb-2'