php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28720 what about a __static() method
Submitted: 2004-06-10 05:33 UTC Modified: 2004-06-10 09:03 UTC
Votes:9
Avg. Score:4.1 ± 1.3
Reproduced:7 of 8 (87.5%)
Same Version:4 (57.1%)
Same OS:4 (57.1%)
From: dardo at gigared dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5CVS-2004-06-10 (dev) OS: all
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-06-10 05:33 UTC] dardo at gigared dot com
Description:
------------
i need to execute a static block of code only one time per 
class 
this is a OOP improvement to php 
 
i wish this 
 
class foo{ 
	$var=123; 
	function __static(){ 
		$this->var+=40; 
	} 
} 
 
like static { } java statement 
 
:P 
 
thanks.. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-10 09:03 UTC] derick@php.net
No thanks, we will not add this. PHP is not Java.
 [2010-05-17 02:49 UTC] markus at malkusch dot de
This autoloader implementation supports the class constructor __static():
http://php-autoloader.malkusch.de/en/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC