Hello community, here is the log from the commit of package php7-redis for openSUSE:Factory checked in at 2017-07-11 08:24:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/php7-redis (Old) and /work/SRC/openSUSE:Factory/.php7-redis.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php7-redis" Tue Jul 11 08:24:49 2017 rev:2 rq:507893 version:3.1.2 Changes: -------- New Changes file: --- /dev/null 2017-06-30 09:57:03.955002226 +0200 +++ /work/SRC/openSUSE:Factory/.php7-redis.new/php5-redis.changes 2017-07-11 08:24:50.307968750 +0200 @@ -0,0 +1,66 @@ +------------------------------------------------------------------- +Tue Jun 27 14:50:44 UTC 2017 - [email protected] + +- Upgraded to version 3.1.2 + * RedisArray segfault fix [564ce3] (Pavlo Yatsukhnenko) + * Small memory leak fix [645888b] (Mike Grunder) + * Segfault fix when recreating RedisCluster objects [abf7d4] (Michael Grunder) + * Fix for RedisCluster bulk response parsing [4121c4] (Alberto Fern?ndez) + * Re allow single array for sInterStore [6ef0c2, d01966] (Michael Grunder) + * Better TravisCI integration [4fd2f6] (Pavlo Yatsukhnenko) + +------------------------------------------------------------------- +Sat Feb 18 06:39:37 UTC 2017 - [email protected] + +- Upgraded to version 3.1.1 + This release contains mostly fixes for issues introduced when merging + the php 5 and 7 codebase into a single branch. + + * Fixed a segfault in igbinary serialization (@yatsukhnenko) + * Restore 2.2.8/3.0.0 functionality to distinguish between an error + and simply empty session data. (@remicollet) + * Fix double to string conversion function (@yatsukhnenko) + * Use PHP_FE_END definition when available (@remicollet) + * Fixed various 'static function declared but not used' warnings + * Fixes to various calls which were typecasting pointers to the wrong size. (@remicollet) + + * Additional test updates for 32 bit systems (@remicollet) + * ARM rounding issue in tests (@remicollet) + * Use new zend_list_close instead of zend_list_delete when reconnecting. + * Refactoring of redis_boolean_response_impl and redis_sock_write (@yatsukhnenko) + * Added php session unit test (@yatsukhnenko) + * Added explicit module dependancy for igbinary (@remicollet) + * Added phpinfo serialization information (@remicollet) + +- Version 3.1.0 + In this version of phpredis codebase was unified to work with all versions of php. + Also many bug fixes and some improvements has been made. + +- Improvements + * Support the client to Redis Cluster just having one master (andyli) [892e5646] + * Allow both long and strings that are longs for zrangebyscore offset/limit (Michael Grunder) [bdcdd2aa] + * Process NX|XX, CH and INCR options in zAdd command (Pavlo Yatsukhnenko) [71c9f7c8] +- Fixes + * Fix incrby/decrby for large integers (Michael Grunder) [3a12758a] + * Use static declarations for spl_ce_RuntimeException decl (Jeremy Mikola) [a9857d69] + * Fixed method call problem causes session handler to display two times (ZiHang Gao) [24f86c49] + * psetex method returns '+OK' on success, not true (sitri@ndxbn) [afcd8445] + * Fix integer overflow for long (>32bit) increments in hIncrBy (iyesin) [58e1d799] + * Move zend_object handler to the end (Michael Grunder) [34107966] + * Using setOption on redis array causes immediate connection (Pavlo Yatsukhnenko) [f1a85b38] + +------------------------------------------------------------------- +Sun Jan 29 06:00:00 UTC 2017 - [email protected] + +- Provide php-redis as php5 and php7 can't be installed together + +------------------------------------------------------------------- +Tue Jan 10 14:18:38 UTC 2017 - [email protected] + +- Updated to version 3.0.0 - no changelog provided + +------------------------------------------------------------------- +Tue Mar 8 10:45:25 UTC 2016 - [email protected] + +- Update build from php7 branch + --- /work/SRC/openSUSE:Factory/php7-redis/php7-redis.changes 2017-04-20 20:49:40.322806612 +0200 +++ /work/SRC/openSUSE:Factory/.php7-redis.new/php7-redis.changes 2017-07-11 08:24:50.407954648 +0200 @@ -1,0 +2,11 @@ +Tue Jun 27 14:50:44 UTC 2017 - [email protected] + +- Upgraded to version 3.1.2 + * RedisArray segfault fix [564ce3] (Pavlo Yatsukhnenko) + * Small memory leak fix [645888b] (Mike Grunder) + * Segfault fix when recreating RedisCluster objects [abf7d4] (Michael Grunder) + * Fix for RedisCluster bulk response parsing [4121c4] (Alberto Fern?ndez) + * Re allow single array for sInterStore [6ef0c2, d01966] (Michael Grunder) + * Better TravisCI integration [4fd2f6] (Pavlo Yatsukhnenko) + +------------------------------------------------------------------- Old: ---- phpredis-3.1.1.tar.gz New: ---- php5-redis.changes php5-redis.spec phpredis-3.1.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ php5-redis.spec ++++++ # # spec file for package php5-redis # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define php_name php5 %define pkg_name phpredis Name: php5-redis Version: 3.1.2 Release: 0 Summary: Interface for communicating with the Redis key-value store License: PHP-3.01 Group: Productivity/Networking/Web/Servers Url: https://github.com/phpredis/phpredis Source0: https://github.com/phpredis/%{pkg_name}/archive/%{version}.tar.gz#/%{pkg_name}-%{version}.tar.gz BuildRequires: %{php_name} BuildRequires: %{php_name}-devel BuildRequires: %{php_name}-soap Provides: php-%{pkg_name} = %{version} Obsoletes: php-%{pkg_name} < %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{?php_zend_api}0 Requires: php(api) = %{php_core_api} Requires: php(zend-abi) = %{php_zend_api} %else %requires_eq %{php_name} %endif %description The phpredis extension provides an API for communicating with the Redis key-value store. %prep %setup -q -n %{pkg_name}-%{version} mkdir %{name} %build %{_bindir}/phpize pushd %{name} export CFLAGS="%{optflags}" ../configure --enable-phpredis sed -i -e 's|PHP_EXECUTABLE = %{_bindir}/php-cgi|PHP_EXECUTABLE = %{_bindir}/php|' Makefile make %{?_smp_mflags} popd %install make DESTDIR=%{buildroot} install %{?_smp_mflags} -C %{name} INSTALL_ROOT=%{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/%{php_name}/conf.d echo "extension=redis.so" > %{buildroot}%{_sysconfdir}/%{php_name}/conf.d/redis.ini %check # only check if the extension can be loaded %{_bindir}/php \ --no-php-ini \ --define extension=%{buildroot}%{_libdir}/%{php_name}/extensions/redis.so \ --modules | grep redis if [ -x %{_bindir}/zts-php ] ; then %{_bindir}/zts-php \ --no-php-ini \ --define extension=%{buildroot}%{_libdir}/%{php_name}/extensions/redis.so \ --modules | grep redis fi # other tests qhich require redis can not be run %files %defattr(-,root,root,-) %{_libdir}/%{php_name}/extensions/redis.so %config(noreplace) %{_sysconfdir}/%{php_name}/conf.d/redis.ini %doc COPYING CREDITS %changelog ++++++ php7-redis.spec ++++++ --- /var/tmp/diff_new_pack.0GJv30/_old 2017-07-11 08:24:50.991872291 +0200 +++ /var/tmp/diff_new_pack.0GJv30/_new 2017-07-11 08:24:50.995871727 +0200 @@ -19,7 +19,7 @@ %define php_name php7 %define pkg_name phpredis Name: php7-redis -Version: 3.1.1 +Version: 3.1.2 Release: 0 Summary: Interface for communicating with the Redis key-value store License: PHP-3.01 ++++++ phpredis-3.1.1.tar.gz -> phpredis-3.1.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/.travis.yml new/phpredis-3.1.2/.travis.yml --- old/phpredis-3.1.1/.travis.yml 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/.travis.yml 2017-03-24 21:11:38.000000000 +0100 @@ -10,27 +10,26 @@ - nightly env: CC=gcc matrix: - include: - - env: CC=clang - php: 5.4 - - env: CC=clang - php: 5.5 - - env: CC=clang - php: 5.6 - - env: CC=clang - php: 7.0 - - env: CC=clang - php: 7.1 - - env: CC=clang - php: nightly allow_failures: - php: nightly + include: + - php: 5.4 + env: CC=clang + - php: 5.5 + env: CC=clang + - php: 5.6 + env: CC=clang + - php: 7.0 + env: CC=clang + - php: 7.1 + env: CC=clang addons: apt: packages: clang before_install: - phpize - - if [ $(phpenv version-name) lt 7 ]; then pecl install igbinary-1.2.1; ./configure --enable-redis-igbinary CFLAGS=-Wall; else ./configure CFLAGS=-Wall; fi + - pecl install igbinary + - ./configure --enable-redis-igbinary CFLAGS=-Wall install: make install before_script: - gem install redis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/cluster_library.c new/phpredis-3.1.2/cluster_library.c --- old/phpredis-3.1.1/cluster_library.c 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/cluster_library.c 2017-03-24 21:11:38.000000000 +0100 @@ -1870,7 +1870,11 @@ RETVAL_TRUE; break; case TYPE_BULK: - RETVAL_STRINGL(r->str, r->len); + if (r->len < 0) { + RETVAL_NULL(); + } else { + RETVAL_STRINGL(r->str, r->len); + } break; case TYPE_MULTIBULK: array_init(z_arr); @@ -1896,8 +1900,12 @@ add_next_index_bool(&c->multi_resp, 1); break; case TYPE_BULK: - add_next_index_stringl(&c->multi_resp, r->str, r->len); - efree(r->str); + if (r->len < 0) { + add_next_index_null(&c->multi_resp); + } else { + add_next_index_stringl(&c->multi_resp, r->str, r->len); + efree(r->str); + } break; case TYPE_MULTIBULK: cluster_mbulk_variant_resp(r, &c->multi_resp); @@ -2028,7 +2036,7 @@ // Return our array if(CLUSTER_IS_ATOMIC(c)) { - RETVAL_ZVAL(z_result, 1, 0); + RETVAL_ZVAL(z_result, 0, 1); } else { add_next_index_zval(&c->multi_resp, z_result); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/library.c new/phpredis-3.1.2/library.c --- old/phpredis-3.1.1/library.c 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/library.c 2017-03-24 21:11:38.000000000 +0100 @@ -900,7 +900,7 @@ PHP_REDIS_API void redis_info_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zval *z_tab, void *ctx) { char *response; int response_len; - zval zv, *z_ret = &zv; + zval zv = {{0}}, *z_ret = &zv; /* Read bulk response */ if ((response = redis_sock_read(redis_sock, &response_len TSRMLS_CC)) == NULL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/package.xml new/phpredis-3.1.2/package.xml --- old/phpredis-3.1.1/package.xml 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/package.xml 2017-03-24 21:11:38.000000000 +0100 @@ -27,10 +27,10 @@ <email>[email protected]</email> <active>yes</active> </lead> - <date>2017-02-01</date> + <date>2017-03-24</date> <version> - <release>3.1.1</release> - <api>3.1.1</api> + <release>3.1.2</release> + <api>3.1.2</api> </version> <stability> <release>stable</release> @@ -38,30 +38,14 @@ </stability> <license uri="http://www.php.net/license">PHP</license> <notes> - phpredis 3.1.1 + phpredis 3.1.2 - * Additional test updates for 32 bit systems (@remicollet) - * ARM rounding issue in tests (@remicollet) - * Use new zend_list_close instead of zend_list_delete when reconnecting. - * Refactoring of redis_boolean_response_impl and redis_sock_write (@yatsukhnenko) - - phpredis 3.1.1 - - This release contains mostly fixes for issues introduced when merging - the php 5 and 7 codebase into a single branch. - - * Fixed a segfault in igbinary serialization (@yatsukhnenko) - * Restore 2.2.8/3.0.0 functionality to distinguish between an error - and simply empty session data. (@remicollet) - * Fix double to string conversion function (@yatsukhnenko) - * Use PHP_FE_END definition when available (@remicollet) - * Fixed various 'static function declared but not used' warnings - * Fixes to various calls which were typecasting pointers to the - wrong size. (@remicollet) - - * Added php session unit test (@yatsukhnenko) - * Added explicit module dependancy for igbinary (@remicollet) - * Added phpinfo serialization information (@remicollet) + * RedisArray segfault fix [564ce3] (Pavlo Yatsukhnenko) + * Small memory leak fix [645888b] (Mike Grunder) + * Segfault fix when recreating RedisCluster objects [abf7d4] (Michael Grunder) + * Fix for RedisCluster bulk response parsing [4121c4] (Alberto Fernández) + * Re allow single array for sInterStore [6ef0c2, d01966] (Michael Grunder) + * Better TravisCI integration [4fd2f6] (Pavlo Yatsukhnenko) </notes> <contents> <dir name="/"> @@ -104,7 +88,7 @@ <dependencies> <required> <php> - <min>5.2.0</min> + <min>5.3.0</min> <max>7.9.99</max> </php> <pearinstaller> @@ -115,20 +99,37 @@ <providesextension>redis</providesextension> <extsrcrelease/> <changelog> + <release> <stability><release>stable</release><api>stable</api></stability> - <version><release>3.1.1</release><api>3.1.1</api></version> - <date>2017-02-01</date> + <version><release>3.1.2</release><api>3.1.2</api></version> + <date>2017-03-16</date> <notes> + phpredis 3.1.2 - phpredis 3.1.1 + * RedisArray segfault fix [564ce3] (Pavlo Yatsukhnenko) + * Small memory leak fix [645888b] (Mike Grunder) + * Segfault fix when recreating RedisCluster objects [abf7d4] (Michael Grunder) + * Fix for RedisCluster bulk response parsing [4121c4] (Alberto Fernández) + * Re allow single array for sInterStore [6ef0c2, d01966] (Michael Grunder) + * Better TravisCI integration [4fd2f6] (Pavlo Yatsukhnenko) + </notes> + </release> + + <release> + <stability><release>beta</release><api>beta</api></stability> + <version><release>3.1.1RC2</release><api>3.1.1RC2</api></version> + <date>2017-01-16</date> + <notes> + + phpredis 3.1.1RC2 * Additional test updates for 32 bit systems (@remicollet) * ARM rounding issue in tests (@remicollet) * Use new zend_list_close instead of zend_list_delete when reconnecting. * Refactoring of redis_boolean_response_impl and redis_sock_write (@yatsukhnenko) - phpredis 3.1.1 + phpredis 3.1.1.RC1 This release contains mostly fixes for issues introduced when merging the php 5 and 7 codebase into a single branch. @@ -222,7 +223,7 @@ * Fixed dreaded size_t vs long long compiler warning </notes> </release> - + <release> <stability><release>stable</release><api>stable</api></stability> <version><release>2.2.7</release><api>2.2.7</api></version> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/php_redis.h new/phpredis-3.1.2/php_redis.h --- old/phpredis-3.1.1/php_redis.h 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/php_redis.h 2017-03-24 21:11:38.000000000 +0100 @@ -25,7 +25,7 @@ #define PHP_REDIS_H /* phpredis version */ -#define PHP_REDIS_VERSION "3.1.1" +#define PHP_REDIS_VERSION "3.1.2" PHP_METHOD(Redis, __construct); PHP_METHOD(Redis, __destruct); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/redis_array_impl.c new/phpredis-3.1.2/redis_array_impl.c --- old/phpredis-3.1.1/redis_array_impl.c 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/redis_array_impl.c 2017-03-24 21:11:38.000000000 +0100 @@ -350,7 +350,7 @@ ra->pconnect = b_pconnect; ra->connect_timeout = connect_timeout; - if (ra_load_hosts(ra, hosts, retry_interval, b_lazy_connect TSRMLS_CC) == NULL) { + if (ra_load_hosts(ra, hosts, retry_interval, b_lazy_connect TSRMLS_CC) == NULL || !ra->count) { for (i = 0; i < ra->count; ++i) { zval_dtor(&ra->redis[i]); efree(ra->hosts[i]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/redis_cluster.c new/phpredis-3.1.2/redis_cluster.c --- old/phpredis-3.1.1/redis_cluster.c 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/redis_cluster.c 2017-03-24 21:11:38.000000000 +0100 @@ -282,23 +282,19 @@ redisCluster *cluster; // Allocate our actual struct - cluster = emalloc(sizeof(redisCluster)); - memset(cluster, 0, sizeof(redisCluster)); + cluster = ecalloc(1, sizeof(redisCluster)); #else zend_object * create_cluster_context(zend_class_entry *class_type TSRMLS_DC) { redisCluster *cluster; // Allocate our actual struct - cluster = emalloc(sizeof(redisCluster) + sizeof(zval) * (class_type->default_properties_count - 1)); + cluster = ecalloc(1, sizeof(redisCluster) + sizeof(zval) * (class_type->default_properties_count - 1)); #endif // We're not currently subscribed anywhere cluster->subscribed_slot = -1; - // Assume we're up initially - cluster->clusterdown = 0; - // Allocate our RedisSock we'll use to store prefix/serialization flags cluster->flags = ecalloc(1, sizeof(RedisSock)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/redis_commands.c new/phpredis-3.1.2/redis_commands.c --- old/phpredis-3.1.1/redis_commands.c 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/redis_commands.c 2017-03-24 21:11:38.000000000 +0100 @@ -2963,7 +2963,7 @@ char **cmd, int *cmd_len, short *slot, void **ctx) { return gen_varkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, - "SINTERSTORE", sizeof("SINTERSTORE")-1, 2, 0, cmd, cmd_len, slot); + "SINTERSTORE", sizeof("SINTERSTORE")-1, 1, 0, cmd, cmd_len, slot); } /* SUNION */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/tests/RedisClusterTest.php new/phpredis-3.1.2/tests/RedisClusterTest.php --- old/phpredis-3.1.1/tests/RedisClusterTest.php 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/tests/RedisClusterTest.php 2017-03-24 21:11:38.000000000 +0100 @@ -345,6 +345,69 @@ $this->assertTrue(1 === $this->redis->eval($scr,Array($str_key), 1)); $this->assertTrue(1 === $this->redis->evalsha($sha,Array($str_key), 1)); } + + public function testEvalBulkResponse() { + $str_key1 = uniqid() . '-' . rand(1,1000) . '{hash}'; + $str_key2 = uniqid() . '-' . rand(1,1000) . '{hash}'; + + $this->redis->script($str_key1, 'flush'); + $this->redis->script($str_key2, 'flush'); + + $scr = "return {KEYS[1],KEYS[2]}"; + + $result = $this->redis->eval($scr,Array($str_key1, $str_key2), 2); + + $this->assertTrue($str_key1 === $result[0]); + $this->assertTrue($str_key2 === $result[1]); + } + + public function testEvalBulkResponseMulti() { + $str_key1 = uniqid() . '-' . rand(1,1000) . '{hash}'; + $str_key2 = uniqid() . '-' . rand(1,1000) . '{hash}'; + + $this->redis->script($str_key1, 'flush'); + $this->redis->script($str_key2, 'flush'); + + $scr = "return {KEYS[1],KEYS[2]}"; + + $this->redis->multi(); + $this->redis->eval($scr,Array($str_key1, $str_key2), 2); + + $result = $this->redis->exec(); + + $this->assertTrue($str_key1 === $result[0][0]); + $this->assertTrue($str_key2 === $result[0][1]); + } + + public function testEvalBulkEmptyResponse() { + $str_key1 = uniqid() . '-' . rand(1,1000) . '{hash}'; + $str_key2 = uniqid() . '-' . rand(1,1000) . '{hash}'; + + $this->redis->script($str_key1, 'flush'); + $this->redis->script($str_key2, 'flush'); + + $scr = "for _,key in ipairs(KEYS) do redis.call('SET', key, 'value') end"; + + $result = $this->redis->eval($scr,Array($str_key1, $str_key2), 2); + + $this->assertTrue(null === $result); + } + + public function testEvalBulkEmptyResponseMulti() { + $str_key1 = uniqid() . '-' . rand(1,1000) . '{hash}'; + $str_key2 = uniqid() . '-' . rand(1,1000) . '{hash}'; + + $this->redis->script($str_key1, 'flush'); + $this->redis->script($str_key2, 'flush'); + + $scr = "for _,key in ipairs(KEYS) do redis.call('SET', key, 'value') end"; + + $this->redis->multi(); + $this->redis->eval($scr,Array($str_key1, $str_key2), 2); + $result = $this->redis->exec(); + + $this->assertTrue(null === $result[0]); + } /* Cluster specific introspection stuff */ public function testIntrospection() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/phpredis-3.1.1/tests/RedisTest.php new/phpredis-3.1.2/tests/RedisTest.php --- old/phpredis-3.1.1/tests/RedisTest.php 2017-02-01 09:17:35.000000000 +0100 +++ new/phpredis-3.1.2/tests/RedisTest.php 2017-03-24 21:11:38.000000000 +0100 @@ -1407,6 +1407,9 @@ $this->redis->sAdd('{set}t', $i); } + /* Regression test for passing a single array */ + $this->assertEquals($this->redis->sInterStore(Array('{set}k', '{set}x', '{set}y')), count(array_intersect($x,$y))); + $count = $this->redis->sInterStore('{set}k', '{set}x', '{set}y'); // odd prime numbers $this->assertEquals($count, $this->redis->scard('{set}k')); foreach(array_intersect($x, $y) as $i) {
