You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,11 +36,11 @@ Let's save the contents of the '`$data`' variable under the '`$key`' key:
36
36
$cache->save($key, $data);
37
37
```
38
38
39
-
This way, we can read from the cache: (if there is no such item in the cache, the `NULL` value is returned)
39
+
This way, we can read from the cache: (if there is no such item in the cache, the `null` value is returned)
40
40
41
41
```php
42
42
$value = $cache->load($key);
43
-
if ($value === NULL) ...
43
+
if ($value === null) ...
44
44
```
45
45
46
46
Method `load()` has second parameter `callable``$fallback`, which is called when there is no such item in the cache. This callback receives the array *$dependencies* by reference, which you can use for setting expiration rules.
We could delete the item from the cache either by saving NULL or by calling `remove()` method:
55
+
We could delete the item from the cache either by saving null or by calling `remove()` method:
56
56
57
57
```php
58
-
$cache->save($key, NULL);
58
+
$cache->save($key, null);
59
59
// or
60
60
$cache->remove($key);
61
61
```
@@ -99,7 +99,7 @@ if ($block = $cache->start($key)) {
99
99
}
100
100
```
101
101
102
-
In case that the output is already present in the cache, the `start()` method prints it and return `NULL`. Otherwise, it starts to buffer the output and
102
+
In case that the output is already present in the cache, the `start()` method prints it and return `null`. Otherwise, it starts to buffer the output and
103
103
returns the `$block` object using which we finally save the data to the cache.
0 commit comments