php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49131 Cached functions (new feature to improve performance)
Submitted: 2009-08-01 15:37 UTC Modified: 2010-11-24 15:05 UTC
From: vesomy at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 6SVN-2009-08-01 (SVN) OS: Irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-08-01 15:37 UTC] vesomy at gmail dot com
Description:
------------
Many functions perform operation like fetch data from database and return value should be cached.
Standard solution:

function get_visible_pages(){
	static $return = false;
	if($return === false){
		$return = fetch_visible_pages_from_db();
	}
	return $return;
}

I think php shold automate this in way like:

cached function get_visible_pages(){
	$return = fetch_visible_pages_from_db();
	return $return;
}

Thanks!



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 15:05 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-11-24 15:05 UTC] jani@php.net
There are several different 3rd party solutions for cacheing, use those.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 12:01:31 2024 UTC