[PHP-BUG] Bug #62342 [NEW]: self:$var - PHP should produce an error

2012-06-17 Thread 007not at gmail dot com
From: 007not at gmail dot com
Operating system: win, linux
PHP version:  5.4Git-2012-06-17 (snap)
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:self:$var - PHP should produce an error

Description:

Take a good look in the code, a special attention to : at line 10. I think
that PHP should produce an error in this line.

Test script:
---
https://bugs.php.net/bug.php?id=62342&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62342&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62342&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62342&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62342&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62342&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62342&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62342&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62342&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62342&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62342&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62342&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62342&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62342&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62342&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62342&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62342&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62342&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62342&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62342&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62342&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62342&r=mysqlcfg



#43392 [NEW]: problem with xml comments

2007-11-23 Thread 007NOT at gmail dot com
From: 007NOT at gmail dot com
Operating system: win xp sp2
PHP version:  5.2.5
PHP Bug Type: SimpleXML related
Bug description:  problem with xml comments

Description:

simpleXml makes counteble xml comments. see code:

Reproduce code:
---
$string = << 

 
 

XML;
$xml = simplexml_load_string($string);
echo "Node: ". count((array) $xml->node) . "\n";//expects 0
echo "Other Node: ".count((array) $xml->otherNode) . "\n";  //expects 1

Expected result:

Node: 0
Other Node: 0

Actual result:
--
Node: 1
Other Node: 0

-- 
Edit bug report at http://bugs.php.net/?id=43392&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43392&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43392&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43392&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43392&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43392&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43392&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43392&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43392&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43392&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43392&r=support
Expected behavior:http://bugs.php.net/fix.php?id=43392&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43392&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43392&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43392&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43392&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43392&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43392&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43392&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43392&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43392&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43392&r=mysqlcfg


#43542 [NEW]: simpleXML thinks that comment is node

2007-12-09 Thread 007not at gmail dot com
From: 007not at gmail dot com
Operating system: win xp sp2
PHP version:  5.2.5
PHP Bug Type: SimpleXML related
Bug description:  simpleXML thinks that comment is node

Description:

also see http://bugs.php.net/43392
>[EMAIL PROTECTED] comment:
>This is just normal and expected behaviour.
> is not same as .
>(try var_dump($xml); to see what happens)

i made some new test for you, and try to var_dump() this
var_dump(array(/*'comment' => 'value'*/));
 ===  && array(/*'comment' =>
'value'*/) === array('comment' => 'value')
is it still be same ? ;)

Reproduce code:
---
$string = <<

 
 
 value

XML;
$xml = simplexml_load_string($string);

//note: xdebug used

//first test
var_dump($xml->node);
var_dump($xml->otherNode);

/*
Expected result:

null

object(SimpleXMLElement)[2]
  public 'comment' => string 'value' (length=5)

Actual result:
--
object(SimpleXMLElement)[2]
  public 'comment' =>
object(SimpleXMLElement)[4]

object(SimpleXMLElement)[2]
  public 'comment' => string 'value' (length=5)
*/



//second test
$i = 0;
foreach ($xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ($xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";

/*
Expected result:

0
1

Actual result:
--
1
1
*/

//third test
var_dump($xml->node->comment);
var_dump($xml->otherNode->comment);

//check magic
echo "node:\n";
if (is_object($xml->node->comment))
{
echo "is_object === TRUE \n";
}
if (isset($xml->node->comment))
{
echo "isset === TRUE \n";
}
//but
if (strlen($xml->node->comment) > 0)
{
echo "strlen > 0\n";
}
if (strlen($xml->node->comment) == 0)
{
echo "strlen == 0\n";
}

echo "otherNode:\n";
if (is_object($xml->otherNode->comment))
{
echo "is_object === TRUE \n";
}
if (isset($xml->otherNode->comment))
{
echo "isset === TRUE \n";
}

/*
Expected result:

node:
is_object === TRUE
isset === TRUE
strlen == 0
otherNode:
is_object === TRUE

Actual result:
--
node:
is_object === TRUE
strlen == 0
otherNode:
is_object === TRUE
*/

Expected result:

see code

Actual result:
--
see code

-- 
Edit bug report at http://bugs.php.net/?id=43542&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43542&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43542&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43542&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43542&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43542&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43542&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43542&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43542&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43542&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43542&r=support
Expected behavior:http://bugs.php.net/fix.php?id=43542&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43542&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43542&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43542&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43542&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43542&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43542&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43542&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43542&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43542&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43542&r=mysqlcfg


#43542 [Opn]: simpleXML thinks that comment is node

2007-12-10 Thread 007not at gmail dot com
 ID:   43542
 User updated by:  007not at gmail dot com
 Reported By:  007not at gmail dot com
 Status:   Open
 Bug Type: SimpleXML related
 Operating System: win xp sp2
 PHP Version:  5.2.5
 New Comment:

hubert, you rigth about first test, i made mistake while i made posting
of this bug.
the right firts test looks such:
//first test
echo "node:";
var_dump($xml->node);
echo "notExitsNode:";
var_dump($xml->notExitsNode);
echo "otherNode:";
var_dump($xml->otherNode);

Expected result:

node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
null

otherNode:
object(SimpleXMLElement)[2]

Actual result:
--
node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
object(SimpleXMLElement)[2]

otherNode:
object(SimpleXMLElement)[2]



>Actually, that "comment" property might have been intentionally
created
as a way to indicate whether the node has a comment.
But it is illogical, and we will have "comments hell" like:
array(/*'comment' => 'value'*/) === array('comment' => 'value')


>As for your second test, I'm afraid it is incorrect
may be (because i tryed to count nodes, and it must be 1 1), but when
we use arrays we have problems with fake comments
$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";


Expected result:

0
0
Actual result:
--
1
0

#
updated test:


 
 
 value

XML;
$xml = simplexml_load_string($string);

//first test
echo "node:";
var_dump($xml->node);
echo "notExitsNode:";
var_dump($xml->notExitsNode);
echo "otherNode:";
var_dump($xml->otherNode);

/*
Expected result:

node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
null

otherNode:
object(SimpleXMLElement)[2]

Actual result:
--
node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
object(SimpleXMLElement)[2]

otherNode:
object(SimpleXMLElement)[2]
*/



//second test
$i = 0;
foreach ($xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ($xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";

/*
Expected result:

1
1
0
0

Actual result:
--
1
1
1
0
*/

//third test
var_dump($xml->node->comment);
var_dump($xml->otherNode->comment);

//check magic
echo "node:\n";
if (is_object($xml->node->comment))
{
echo "is_object === TRUE \n";
}
if (isset($xml->node->comment))
{
echo "isset === TRUE \n";
}
//but
if (strlen($xml->node->comment) > 0)
{
echo "strlen > 0\n";
}
if (strlen($xml->node->comment) == 0)
{
echo "strlen == 0\n";
}

echo "otherNode:\n";
if (is_object($xml->otherNode->comment))
{
echo "is_object === TRUE \n";
}
if (isset($xml->otherNode->comment))
{
echo "isset === TRUE \n";
}

/*
Expected result:

node:
is_object === TRUE
isset === TRUE
strlen == 0
otherNode:
is_object === TRUE

Actual result:
--
node:
is_object === TRUE
strlen == 0
otherNode:
is_object === TRUE
*/


Previous Comments:


[2007-12-09 14:39:46] hubert dot roksor at gmail dot com

Regarding your first test, I wouldn't consider that a bug. var_dump()
is a debugging tool, it may expose some of the behind-the-scene magic.
Actually, that "comment" property might have been intentionally created
as a way to indicate whether the node has a comment. That would explain
isset()'s behaviour in your third test, but in this case I would
recommand replacing that magical property with a method such as
$node->hasComment(). I guess Rob Richards will be able to shed some
light here.

As for your second test, I'm afraid it is incorrect: both $xml->node
and $xml->otherNode should return 1 element and I don't see why having a
comment as a child would change that.



[2007-12-09 11:02:10] 007not at gmail dot com

#43542 [Com]: simpleXML thinks that comment is node

2007-12-23 Thread 007NOT at gmail dot com
 ID:   43542
 Comment by:   007NOT at gmail dot com
 Reported By:  007not at gmail dot com
 Status:   Open
 Bug Type: SimpleXML related
 Operating System: *
 PHP Version:  5.2.5
 New Comment:

>The comment is a node. 
comment isn't node, it's nothing
exsampe:
 - node with empty value
 - node with empty value
  - but not empty node thats has value
"space"

in :
>$i = 0;
>foreach ((array) $xml->node as $node)
>{
>   $i++;
>}
>echo $i . "\n";
he we checks child nodes, but not checks that node exists

see one more test:


 
 
 value

XML;
$xml = simplexml_load_string($string);

$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$dom= new DOMDocument();
$dom->loadXML($string);
$Xpath = new domxpath($dom);
$NodeList = $Xpath->query('/document');
foreach ($NodeList as $Node)
{
foreach ($Node->childNodes as $cNode)
{
echo 'Name: ' . $cNode->nodeName . ' Value: ' . $cNode->nodeValue .
PHP_EOL;
if ($cNode->childNodes->length > 1) echo 'Has childNodes' . PHP_EOL;
}
}

>What we actually need is a way to figure out the xml type of a
SimpleXMLElement instance (Element, Comment,...). 
may be you make new metod


Previous Comments:


[2007-12-20 14:39:45] [EMAIL PROTECTED]

The comment is a node. What we actually need is a way to figure out the
xml type of a SimpleXMLElement instance (Element, Comment,...). This
will also have to return the internal SXE state (iterator for something
or direct value).



[2007-12-10 20:29:17] 007not at gmail dot com

hubert, you rigth about first test, i made mistake while i made posting
of this bug.
the right firts test looks such:
//first test
echo "node:";
var_dump($xml->node);
echo "notExitsNode:";
var_dump($xml->notExitsNode);
echo "otherNode:";
var_dump($xml->otherNode);

Expected result:

node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
null

otherNode:
object(SimpleXMLElement)[2]

Actual result:
--
node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
object(SimpleXMLElement)[2]

otherNode:
object(SimpleXMLElement)[2]



>Actually, that "comment" property might have been intentionally
created
as a way to indicate whether the node has a comment.
But it is illogical, and we will have "comments hell" like:
array(/*'comment' => 'value'*/) === array('comment' => 'value')


>As for your second test, I'm afraid it is incorrect
may be (because i tryed to count nodes, and it must be 1 1), but when
we use arrays we have problems with fake comments
$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";


Expected result:

0
0
Actual result:
--
1
0

#
updated test:


 
 
 value

XML;
$xml = simplexml_load_string($string);

//first test
echo "node:";
var_dump($xml->node);
echo "notExitsNode:";
var_dump($xml->notExitsNode);
echo "otherNode:";
var_dump($xml->otherNode);

/*
Expected result:

node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
null

otherNode:
object(SimpleXMLElement)[2]

Actual result:
--
node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
object(SimpleXMLElement)[2]

otherNode:
object(SimpleXMLElement)[2]
*/



//second test
$i = 0;
foreach ($xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ($xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";

/*
Expected result:

1
1
0
0

Actual result:
--
1
1
1
0
*/

//third test
var_dump($xml->node->comment);
var_dump($xml->otherNode->comment);

//check magic
echo "node:\n";
if (is_object($xml->node->comment))
{
echo "is_object === TRUE \n";
}
if (isset($xml->node->comment))
{
echo "isset === TRUE \n";
}
//but
if (

#43722 [NEW]: session.bug_compat_42 default value in php.ini

2007-12-31 Thread 007NOT at gmail dot com
From: 007NOT at gmail dot com
Operating system: all
PHP version:  5.2.5
PHP Bug Type: Feature/Change Request
Bug description:  session.bug_compat_42 default value in php.ini

Description:

PHP 4 end of life == 2007-12-31
so that we no more need compatibility with php4 in php5 ;)
sorry for my bad english :(

Reproduce code:
---
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, albeit
register_globals
; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled.

session.bug_compat_42 = 1
session.bug_compat_warn = 1

Expected result:

session.bug_compat_42 = 0
session.bug_compat_warn = 0

Actual result:
--
session.bug_compat_42 = 1
session.bug_compat_warn = 1

-- 
Edit bug report at http://bugs.php.net/?id=43722&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43722&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43722&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43722&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43722&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43722&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43722&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43722&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43722&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43722&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43722&r=support
Expected behavior:http://bugs.php.net/fix.php?id=43722&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43722&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43722&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43722&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43722&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43722&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43722&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43722&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43722&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43722&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43722&r=mysqlcfg


#43542 [Com]: simpleXML thinks that comment is node

2008-01-11 Thread 007NOT at gmail dot com
 ID:   43542
 Comment by:   007NOT at gmail dot com
 Reported By:  007not at gmail dot com
 Status:   Open
 Bug Type: SimpleXML related
 Operating System: *
 PHP Version:  5.2.5
 New Comment:

helly wrote:
>The comment is a node.
SimpleXMLElement->children() do not think so !!! where is the TRUE ?

exsample:


 
  
  
 

XML;
$xml = simplexml_load_string($string);

var_dump($xml->node);
$i = 0;
foreach ($xml->node as $node)
{
$i++;
}
echo $i . "\n";

var_dump((array) $xml->node);
$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

var_dump($xml->node->children());
$i = 0;
foreach ((array) $xml->node->children() as $node)
{
$i++;
}
echo $i . "\n";


Previous Comments:
----------------

[2007-12-23 20:07:58] 007NOT at gmail dot com

>The comment is a node. 
comment isn't node, it's nothing
exsampe:
 - node with empty value
 - node with empty value
  - but not empty node thats has value
"space"

in :
>$i = 0;
>foreach ((array) $xml->node as $node)
>{
>   $i++;
>}
>echo $i . "\n";
he we checks child nodes, but not checks that node exists

see one more test:


 
 
 value

XML;
$xml = simplexml_load_string($string);

$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$dom= new DOMDocument();
$dom->loadXML($string);
$Xpath = new domxpath($dom);
$NodeList = $Xpath->query('/document');
foreach ($NodeList as $Node)
{
foreach ($Node->childNodes as $cNode)
{
echo 'Name: ' . $cNode->nodeName . ' Value: ' . $cNode->nodeValue .
PHP_EOL;
if ($cNode->childNodes->length > 1) echo 'Has childNodes' . PHP_EOL;
}
}

>What we actually need is a way to figure out the xml type of a
SimpleXMLElement instance (Element, Comment,...). 
may be you make new metod



[2007-12-20 14:39:45] [EMAIL PROTECTED]

The comment is a node. What we actually need is a way to figure out the
xml type of a SimpleXMLElement instance (Element, Comment,...). This
will also have to return the internal SXE state (iterator for something
or direct value).



[2007-12-10 20:29:17] 007not at gmail dot com

hubert, you rigth about first test, i made mistake while i made posting
of this bug.
the right firts test looks such:
//first test
echo "node:";
var_dump($xml->node);
echo "notExitsNode:";
var_dump($xml->notExitsNode);
echo "otherNode:";
var_dump($xml->otherNode);

Expected result:

node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
null

otherNode:
object(SimpleXMLElement)[2]

Actual result:
--
node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
object(SimpleXMLElement)[2]

otherNode:
object(SimpleXMLElement)[2]



>Actually, that "comment" property might have been intentionally
created
as a way to indicate whether the node has a comment.
But it is illogical, and we will have "comments hell" like:
array(/*'comment' => 'value'*/) === array('comment' => 'value')


>As for your second test, I'm afraid it is incorrect
may be (because i tryed to count nodes, and it must be 1 1), but when
we use arrays we have problems with fake comments
$i = 0;
foreach ((array) $xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0;
foreach ((array) $xml->otherNode as $node)
{
$i++;
}
echo $i . "\n";


Expected result:

0
0
Actual result:
--
1
0

#
updated test:


 
 
 value

XML;
$xml = simplexml_load_string($string);

//first test
echo "node:";
var_dump($xml->node);
echo "notExitsNode:";
var_dump($xml->notExitsNode);
echo "otherNode:";
var_dump($xml->otherNode);

/*
Expected result:

node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
null

otherNode:
object(SimpleXMLElement)[2]

Actual result:
--
node:
object(SimpleXMLElement)[2]
  public 'comment' => 
object(SimpleXMLElement)[4]

notExitsNode:
object(SimpleXMLElement)[2]

otherNode:
object(SimpleXMLElement)[2]
*/



//second test
$i = 0;
foreach ($xml->node as $node)
{
$i++;
}
echo $i . "\n";

$i = 0

#44541 [NEW]: new feature in PDOStatement::fetchAll()

2008-03-26 Thread 007NOT at gmail dot com
From: 007NOT at gmail dot com
Operating system: 
PHP version:  5.2.5
PHP Bug Type: PDO related
Bug description:  new feature in PDOStatement::fetchAll()

Description:

>General error: PDO::FETCH_LAZY can't be used with
PDOStatement::fetchAll()
It seems to me it will be usefull to have parameter fetch_style =
PDO::FETCH_LAZY


-- 
Edit bug report at http://bugs.php.net/?id=44541&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44541&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44541&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44541&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44541&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=44541&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=44541&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=44541&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=44541&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=44541&r=support
Expected behavior:http://bugs.php.net/fix.php?id=44541&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=44541&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=44541&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44541&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44541&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44541&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=44541&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=44541&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44541&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=44541&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=44541&r=mysqlcfg