Skip to content

Commit 1ebf263

Browse files
committed
fix #14
kill iterator_count()
1 parent 6a69814 commit 1ebf263

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/ErrorHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ protected function emailErr($error)
157157
.'line: '.$error['line']."\n"
158158
.'remote_addr: '.$_SERVER['REMOTE_ADDR']."\n"
159159
.'http_host: '.$_SERVER['HTTP_HOST']."\n"
160+
.'referer: '.$_SERVER['HTTP_REFERER']."\n"
160161
.'request_uri: '.$_SERVER['REQUEST_URI']."\n"
161162
.'';
162163
if (!empty($_POST)) {

src/VarDumpObject.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public function getAbstraction($obj, &$hist = array())
423423
if (!$return['isRecursion'] && !$return['excluded']) {
424424
$return['properties'] = $this->getProperties($obj, $hist);
425425
if (in_array('Traversable', $return['implements'])) {
426-
$return['misc']['count'] = iterator_count($obj);
426+
// iterator_count() alters the state of the object!
427427
}
428428
if ($this->debug->varDump->get('collectConstants')) {
429429
$return['constants'] = $reflectionClass->getConstants();
@@ -598,6 +598,16 @@ public function getProperties($obj, &$hist = array())
598598
: array();
599599
$isDebugObj = $objNamespace == __NAMESPACE__;
600600
unset($reflectionObject);
601+
if ($obj instanceof \DOMNodeList) {
602+
// for reasons unknown, DOMNodeList's properties are invisible to reflection
603+
$propArray['length'] = array(
604+
'visibility' => 'public',
605+
'isStatic' => false,
606+
'type' => 'integer',
607+
'value' => $obj->length,
608+
'desc' => VarDump::UNDEFINED,
609+
);
610+
}
601611
while ($properties) {
602612
$prop = array_shift($properties);
603613
$name = $prop->getName();

src/css/Debug.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
font-family: Courier New,monospace,Ariel;
182182
color: #009;
183183
font-size: 1.15em;
184+
line-height: 1.15em;
184185
}
185186
/*.debug .t_object + br { display: none; }*/
186187
.debug .t_key { opacity: .75; }

0 commit comments

Comments
 (0)