File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -356,17 +356,26 @@ $redis->getOption(Redis::OPT_SERIALIZER);
356
356
357
357
### ping
358
358
-----
359
- _ ** Description** _ : Check the current connection status
359
+ _ ** Description** _ : Check the current connection status.
360
360
361
- ##### * Parameters*
362
-
363
- (none)
361
+ ##### * Prototype*
362
+ ~~~ php
363
+ $redis->ping([string $message]);
364
+ ~~~
364
365
365
366
##### * Return value*
367
+ * Mixed* : This method returns ` TRUE ` on success, or the passed string if called with an argument.
366
368
367
- * BOOL* : ` TRUE ` in case of success. Throws a [ RedisException] ( #class-redisexception ) object on connectivity error, as described above.
369
+ ##### * Example*
370
+ ~~~ php
371
+ /* When called without an argument, PING returns `TRUE` */
372
+ $redis->ping();
373
+
374
+ /* If passed an argument, that argument is returned. Here 'hello' will be returned */
375
+ $redis->ping('hello');
376
+ ~~~
368
377
369
- Staring from version 5.0.0, the command returns boolean ` TRUE ` instead of * STRING * ` +PONG ` as in previous versions .
378
+ * Note * : Prior to PhpRedis 5.0.0 this command simply returned the string ` +PONG ` .
370
379
371
380
### echo
372
381
-----
You can’t perform that action at this time.
0 commit comments