[PHP-BUG] Bug #54998 [NEW]: DOMElement::setAttribute fails if the value is : "0"

2011-06-06 Thread ealexs at gmail dot com
From: 
Operating system: Debian squeeze1
PHP version:  5.3.6
Package:  DOM XML related
Bug Type: Bug
Bug description:DOMElement::setAttribute fails if the value is : "0"

Description:

---

>From manual page: http://www.php.net/domelement.setattribute#Description

---



DOMElement::setAttribute fails if the value is : "0" (or 0 as numeric)




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



Req #32100 [Com]: Request 'finally' support for exceptions

2011-05-05 Thread ealexs at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=32100&edit=1

 ID: 32100
 Comment by: ealexs at gmail dot com
 Reported by:ceefour at gauldong dot net
 Summary:Request 'finally' support for exceptions
 Status: Closed
 Type:   Feature/Change Request
 Package:Feature/Change Request
 Operating System:   *
 PHP Version:5.*
 Block user comment: N
 Private report: N

 New Comment:

PHP++ for finally in PHP ;)



my code:



disableSIPTrunk (10 lines of code)



try

{

// do some stuff 

}

finally 

{

enableSIPTrunk (10 lines of code)

}



// saves duplicate code and it's very elegant !


Previous Comments:

[2011-04-05 21:16:06] adam dot pippin at ohmedia dot ca

---

Disable user permission checking

try

{

   Call a half a dozen methods

}

finally

{

   Re-enable user permission checking

}

---



The ten year old discussion I found on the issue
(http://marc.info/?l=php-internals&m=96774165717219&w=3) doesn't seem
terribly applicable to my case. Specifically, it suggests:



---

try {

 ... modify contents ...

} catch {

 ... any error recovery code here ...

}

... cleanup code ...

---



Except my code doesn't 'recover' from errors. It runs back up the call
stack and reports the error to the user. I have absolutely zero use for
a catch here. My workaround (which, unlike a basic rethrow preserves the
line/file):



---

Disable permission checking

try

{

   Run methods

}

catch (Exception $e)

{

   Enable permission checking

   throw new Exception($e->getMessage(), $e->getCode(), $e);

}

Enable permission checking

---



The workaround simply requires a few extra lines of code and a bunch of
duplicated code. But hey, finally isn't required, so it's all good.


[2011-03-20 10:44:01] php at techdp dot co dot uk

+++ for finally in PHP. It is one of the most elegant and expressive
keywords in modern programming, allowing precise capture of error
handling semantics, and easy authorship of bug-free code!


[2011-02-19 17:34:09] gunter at web dot com

++ for finally in PHP.


[2011-02-17 22:02:08] attila dot m dot magyar at gmail dot com

I agree with the previous comments, a 'finally' keyword would be nice
and useful when it fits to the conventions and standards applied in a
project. If it's not hairy to implement and wouldn't introduce
instability in the core, I'd reassure PHP developers to add this feature
in a future release.



Best regards,

Athos


[2011-02-17 17:09:54] tyra3l at gmail dot com

sorry, I screwed up part of my comment when editing:

"and he didn't the first which closed the"

and he didn't explained in his comment why is it rejected, aside the
fact that we (who?) dont't need it



Tyrael




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=32100


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=32100&edit=1


[PHP-BUG] Bug #51570 [NEW]: is_subclass_of fails to autoload the classes

2010-04-16 Thread ealexs at gmail dot com
From: 
Operating system: Debian
PHP version:  5.2.13
Package:  Reproducible crash
Bug Type: Bug
Bug description:is_subclass_of fails to autoload the classes

Description:

is_subclass_of fails to autoload the classes causing PHP do die and apache
returns an empty page. NO error is triggered ! It was very hard to find the
cause



My php config it's here:

http://alex.softdev.ro/info.php



Failing function:

function ClassIsA($object_class, $class)

{

if ($object_class == $class)

return true;

return (is_subclass_of($object_class, $class));

}





If changed it works:



function ClassIsA($object_class, $class)

{

// use this to force the load of the classes

if (!class_exists($object_class))

throw new Exception("Class $object_class not found");

// use this to force the load of the classes

if (!class_exists($class))

throw new Exception("Class $class not found");



if ($object_class == $class)

return true;

return (is_subclass_of($object_class, $class));

}



looks like calling class_exists calls autoload and works fine



Thanks,

Alex

Test script:
---
Failing function:

function ClassIsA($object_class, $class)

{

if ($object_class == $class)

return true;

return (is_subclass_of($object_class, $class));

}





If changed it works:



function ClassIsA($object_class, $class)

{

// use this to force the load of the classes

if (!class_exists($object_class))

throw new Exception("Class $object_class not found");

// use this to force the load of the classes

if (!class_exists($class))

throw new Exception("Class $class not found");



if ($object_class == $class)

return true;

return (is_subclass_of($object_class, $class));

}


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