Bug #63583 [Nab]: Comparing objects is wrong
Edit report at https://bugs.php.net/bug.php?id=63583edit=1 ID: 63583 User updated by:vadimx at gmail dot com Reported by:vadimx at gmail dot com Summary:Comparing objects is wrong Status: Not a bug Type: Bug Package:SimpleXML related Operating System: * PHP Version:5.3.18 Block user comment: N Private report: N New Comment: So, for compare 2 SimpleXMLElement objects, i have one, not good way var_dump($o1-asXML() == $o2-asXML()), but it's wrong if one space (or \n \t) before tag name are different? Or exists another method, for check if 2 SimpleXMLElement objects are same? Previous Comments: [2012-11-23 01:52:35] ahar...@php.net SimpleXML does implement object comparison, but it compares both the underlying document and node â if they aren't the same (and they aren't, in this case, since both new SimpleXMLElement() calls create new documents and nodes), then the objects aren't the same. [2012-11-22 16:40:48] vadimx at gmail dot com Description: Comparing objects always returns false. How can i compare objects? Test script: --- $xml = 'ab//a'; $a = new SimpleXMLElement($xml); $b = new SimpleXMLElement($xml); var_dump($a == $b); Expected result: bool(true) Actual result: -- bool(false) -- Edit this bug report at https://bugs.php.net/bug.php?id=63583edit=1
[PHP-BUG] Bug #63583 [NEW]: Comparing objects is wrong
From: vadimx at gmail dot com Operating system: * PHP version: 5.3.18 Package: SimpleXML related Bug Type: Bug Bug description:Comparing objects is wrong Description: Comparing objects always returns false. How can i compare objects? Test script: --- $xml = 'ab//a'; $a = new SimpleXMLElement($xml); $b = new SimpleXMLElement($xml); var_dump($a == $b); Expected result: bool(true) Actual result: -- bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=63583edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63583r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63583r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63583r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63583r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63583r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63583r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63583r=needscript Try newer version: https://bugs.php.net/fix.php?id=63583r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63583r=support Expected behavior: https://bugs.php.net/fix.php?id=63583r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63583r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63583r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63583r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63583r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63583r=dst IIS Stability: https://bugs.php.net/fix.php?id=63583r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63583r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63583r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63583r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63583r=mysqlcfg
[PHP-BUG] Bug #63575 [NEW]: Cloning are incorrect
From: vadimx at gmail dot com Operating system: Windows/Linux PHP version: 5.3.18 Package: SimpleXML related Bug Type: Bug Bug description:Cloning are incorrect Description: When changing child's in cloned object, it's change in parent object, not in cloned. Test script: --- $xml = 'ab/b/a'; $o1 = new SimpleXMlElement($xml); $o2 = clone $o1; $r = current($o2-xpath('/a')); $r-addChild('c',new SimpleXMlElement('c/c')); echo $o1-asXML(); echo PHP_EOL; echo $o2-asXML(); Expected result: ?xml version=1.0? ab//a ab/c/c/a Actual result: -- ?xml version=1.0? ab/c/c/a ab//a -- Edit bug report at https://bugs.php.net/bug.php?id=63575edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63575r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63575r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63575r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63575r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63575r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63575r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63575r=needscript Try newer version: https://bugs.php.net/fix.php?id=63575r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63575r=support Expected behavior: https://bugs.php.net/fix.php?id=63575r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63575r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63575r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63575r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63575r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63575r=dst IIS Stability: https://bugs.php.net/fix.php?id=63575r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63575r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63575r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63575r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63575r=mysqlcfg
Bug #52577 [Asn]: Incorrect date returning
Edit report at http://bugs.php.net/bug.php?id=52577edit=1 ID: 52577 User updated by:vadimx at gmail dot com Reported by:vadimx at gmail dot com Summary:Incorrect date returning Status: Assigned Type: Bug Package:Date/time related Operating System: Windows PHP Version:5.3.3 Assigned To:derick Block user comment: N New Comment: When i use date_default_timezone_set('UTC'), all ok. But in doc Note: The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010- 01-28T15:00:00+02:00).. why timezone affect to unixtime? Previous Comments: [2010-08-11 01:08:08] fel...@php.net For example, using date_default_timezone_set('UTC'); I cannot reproduce it. But using your timezone I got same result. [2010-08-11 00:57:51] vadimx at gmail dot com date_default_timezone_set('Europe/Kiev'); But, i try change timezone, but this no effect. [2010-08-11 00:44:17] fel...@php.net What timezone are you using? [2010-08-10 18:23:41] vadimx at gmail dot com Description: When i use unixtime in DateTime object, this returning wrong date, -1 day. Test script: --- $date = '7.8.2010'; echo String: .$date.br; $date_format = 'j.m.Y'; $unixtime = strtotime($date); echo Unixtime: .$unixtime.br; echo Date(PHP): .date($date_format,$unixtime).br; $date = new DateTime('@'.$unixtime); echo DateTime(PHP Class): .$date-format($date_format); Expected result: String: 7.8.2010 Unixtime: 1281128400 Date(PHP): 7.08.2010 DateTime(PHP Class): 7.08.2010 Actual result: -- String: 7.8.2010 Unixtime: 1281128400 Date(PHP): 7.08.2010 DateTime(PHP Class): 6.08.2010 -- Edit this bug report at http://bugs.php.net/bug.php?id=52577edit=1
[PHP-BUG] Bug #52577 [NEW]: Incorrect date returning
From: Operating system: Windows PHP version: 5.3.3 Package: Date/time related Bug Type: Bug Bug description:Incorrect date returning Description: When i use unixtime in DateTime object, this returning wrong date, -1 day. Test script: --- $date = '7.8.2010'; echo String: .$date.br; $date_format = 'j.m.Y'; $unixtime = strtotime($date); echo Unixtime: .$unixtime.br; echo Date(PHP): .date($date_format,$unixtime).br; $date = new DateTime('@'.$unixtime); echo DateTime(PHP Class): .$date-format($date_format); Expected result: String: 7.8.2010 Unixtime: 1281128400 Date(PHP): 7.08.2010 DateTime(PHP Class): 7.08.2010 Actual result: -- String: 7.8.2010 Unixtime: 1281128400 Date(PHP): 7.08.2010 DateTime(PHP Class): 6.08.2010 -- Edit bug report at http://bugs.php.net/bug.php?id=52577edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52577r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52577r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52577r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52577r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52577r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52577r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52577r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52577r=needscript Try newer version: http://bugs.php.net/fix.php?id=52577r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52577r=support Expected behavior: http://bugs.php.net/fix.php?id=52577r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52577r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52577r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52577r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52577r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=52577r=dst IIS Stability: http://bugs.php.net/fix.php?id=52577r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52577r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52577r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52577r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52577r=mysqlcfg
Bug #52577 [Com]: Incorrect date returning
Edit report at http://bugs.php.net/bug.php?id=52577edit=1 ID: 52577 Comment by: vadimx at gmail dot com Reported by:vadimx at gmail dot com Summary:Incorrect date returning Status: Assigned Type: Bug Package:Date/time related Operating System: Windows PHP Version:5.3.3 Assigned To:derick Block user comment: N New Comment: date_default_timezone_set('Europe/Kiev'); But, i try change timezone, but this no effect. Previous Comments: [2010-08-11 00:44:17] fel...@php.net What timezone are you using? [2010-08-10 18:23:41] vadimx at gmail dot com Description: When i use unixtime in DateTime object, this returning wrong date, -1 day. Test script: --- $date = '7.8.2010'; echo String: .$date.br; $date_format = 'j.m.Y'; $unixtime = strtotime($date); echo Unixtime: .$unixtime.br; echo Date(PHP): .date($date_format,$unixtime).br; $date = new DateTime('@'.$unixtime); echo DateTime(PHP Class): .$date-format($date_format); Expected result: String: 7.8.2010 Unixtime: 1281128400 Date(PHP): 7.08.2010 DateTime(PHP Class): 7.08.2010 Actual result: -- String: 7.8.2010 Unixtime: 1281128400 Date(PHP): 7.08.2010 DateTime(PHP Class): 6.08.2010 -- Edit this bug report at http://bugs.php.net/bug.php?id=52577edit=1
Bug #48487 [Com]: fetch_object calls __set before constructor
Edit report at http://bugs.php.net/bug.php?id=48487edit=1 ID: 48487 Comment by: vadimx at gmail dot com Reported by: joel at purerave dot com Summary: fetch_object calls __set before constructor Status: Closed Type: Bug Package: MySQLi related Operating System: win2k sp4 PHP Version: 5.2.9 New Comment: In mysql_fetch_object the same bug. Previous Comments: [2010-01-04 10:31:36] u...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Fixed with http://news.php.net/php.cvs/61460 [2009-11-06 16:29:19] caferrari at gmail dot com Help!.. i am having this issue with php 5.2.10 on Ubuntu 9.10 and Debian 5... and its evil!... my solution: class Exemplo { public function __construct($id=0, $nome='', $sigla=''){ if (isset($this-id)) return; //Ugly solution!!! help! $this-id = $id; $this-nome = $nome; $this-sigla= $sigla; } } [2009-08-25 17:14:42] joel at purerave dot com No response yet? [2009-06-06 20:33:40] joel at purerave dot com Description: mysqli_fetch_object with custom class calls __set() before constructor. Reproduce code: --- ?php $mysqli = new mysqli(localhost, root, root, test); class myData { function __construct($param) { echo 'creating'.PHP_EOL; } function __set($name, $value) { $this-{$name} = $value; echo 'setting'.PHP_EOL; } } $sql = SELECT id FROM test LIMIT 1; $result = $mysqli-query($sql); while ($obj = $result-fetch_object('myData', array('data'))) { } Expected result: creating setting Actual result: -- setting creating -- Edit this bug report at http://bugs.php.net/bug.php?id=48487edit=1