Fix stubs to make them consistent for PHP 8 and add a checkKey() method along with a bug fix#479
Fix stubs to make them consistent for PHP 8 and add a checkKey() method along with a bug fix#479rlerdorf wants to merge 4 commits intophp-memcached-dev:masterfrom
Conversation
Make ascii key check consistent with libmemcached's isgraph() check Add test to check that they match
|
Thanks, Rasmus! I'll review soon. |
|
Merged, thanks. |
|
Thanks @krakjoe! |
|
The iscntrl -> !isgraph is a pretty major change, memcache protocol does support non-ascii keys as outlined in https://github.com/memcached/memcached/blob/master/doc/protocol.txt by implicit statements such as:
and the general key protocol definition:
|
|
Commented in #546 |
These are marked as nullable in the arginfo files in the tree. Without this change regenerating the arginfo with the PHP 8 gen_stubs will flip them to non-nullable.
I actually meant for these to be in separate pull requests, but I got lazy. Pick and choose here.
In the second part I added a userspace checkKey() method so you can check keys without a memcache roundtrip.
But in doing so I noticed that the checks don't match. libmemcached does an isgraph() check on ascii keys while the php-memcached check was iscntrl().
This breaks on many strings as per the test I added.