Re: [REVIEW] PSR-16 Simple Cache

2017-03-15 Thread Rasmus Schultz
It's a default value in case of a miss - it's there mainly to support an edge-case where someone is caching NULL values, and might need to pass a different default value, so they can tell the difference between a cached NULL-value and an actual miss. So in your case: $default = new stdClass()

Re: [REVIEW] PSR-16 Simple Cache

2017-03-15 Thread Brad Kent
I know I'm late to the party, but what's the use-case for passing a default value to the get method? If we're using a cache isn't generating/getting the value expensive? It seems to encourage something boneheaded like: $default = someExpensiveOperation(); $myValue = $myCache->get('foo', $defaul