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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vesomy at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 13:01:33 2025 UTC