From:             
Operating system: 
PHP version:      5.3.3
Package:          Class/Object related
Bug Type:         Feature/Change Request
Bug description:why you should bring back abstract static methods

Description:
------------
hi, i really can not understand why this was dropped, but imagine this
code



please read carefully and please examine my request before trash it



abstract class FSItem

{

      // abstract static method:

      abstract protected function isPathValid($path);



      protected function __construct($path){}



      // random per-item singleton

      public static function getByPath($path)

      {

            if(static::isPathValid($path)) // here is the static method
call of classes. i want to check the path before instance it

                  return new static($path);

      }

}



class Dir extends FSItem

{

     //implementation:

     protected function isPathValid($path)

     {

          return is_dir($path);

     }

}



class File extends FSItem

{

     //implementation:

     protected function isPathValid($path)

     {

          return is_file($path);

     }

}



class Image extends File

{

     //implementation:

     protected function isPathValid($path)

     {

          return (bool)getimagesize($path);

     }

}



php changelog says: 



Dropped abstract static class functions. Due to an oversight, PHP 5.0.x and
5.1.x allowed abstract static functions in classes. As of PHP 5.2.x, only
interfaces can have them. 



oversight what? it is a logical error? technical limitation?



thank you


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

Reply via email to