@@ -196,12 +196,14 @@ Adds the string value to the head (left) of the list. Creates the list if the ke
196
196
* key*
197
197
* value* String, value to push in key
198
198
##### Return value
199
- * BOOL * ` TRUE ` in case of success, ` FALSE ` in case of Failure.
199
+ * LONG * The new length of the list in case of success, ` FALSE ` in case of Failure.
200
200
##### Examples
201
201
<pre >
202
- $redis->lPush('key1', 'C');
203
- $redis->lPush('key1', 'B');
204
- $redis->lPush('key1', 'A'); /* key1 => [ 'A', 'B', 'C' ] */
202
+ $redis->delete('key1');
203
+ $redis->lPush('key1', 'C'); // returns 1
204
+ $redis->lPush('key1', 'B'); // returns 2
205
+ $redis->lPush('key1', 'A'); // returns 3
206
+ /* key1 now points to the following list: [ 'A', 'B', 'C' ] */
205
207
</pre >
206
208
207
209
## rPush
@@ -211,12 +213,14 @@ Adds the string value to the tail (right) of the list. Creates the list if the k
211
213
* key*
212
214
* value* String, value to push in key
213
215
##### Return value
214
- * BOOL * ` TRUE ` in case of success, ` FALSE ` in case of Failure.
216
+ * LONG * The new length of the list in case of success, ` FALSE ` in case of Failure.
215
217
##### Examples
216
218
<pre >
217
- $redis->rPush('key1', 'A');
218
- $redis->rPush('key1', 'B');
219
- $redis->rPush('key1', 'C'); /* key1 => [ 'A', 'B', 'C' ] */
219
+ $redis->delete('key1');
220
+ $redis->rPush('key1', 'A'); // returns 1
221
+ $redis->rPush('key1', 'B'); // returns 2
222
+ $redis->rPush('key1', 'C'); // returns 3
223
+ /* key1 now points to the following list: [ 'A', 'B', 'C' ] */
220
224
</pre >
221
225
222
226
## lPop
0 commit comments