php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72072 PHP7 Support
Submitted: 2016-04-22 07:40 UTC Modified: 2019-09-02 13:12 UTC
Votes:21
Avg. Score:4.9 ± 0.3
Reproduced:19 of 19 (100.0%)
Same Version:16 (84.2%)
Same OS:18 (94.7%)
From: cs at linux-administrator dot com Assigned: michael (profile)
Status: Assigned Package: expect (PECL)
PHP Version: 7.0.5 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cs at linux-administrator dot com
New email:
PHP Version: OS:

 

 [2016-04-22 07:40 UTC] cs at linux-administrator dot com
Description:
------------
The expect extension 0.3.3 can't  be build for php7, please provide an update
which is compatible with php7.

[  131s] + /usr/bin/make -j1
[  131s] /bin/sh /usr/src/packages/BUILD/expect-0.3.3/libtool --mode=compile cc  -I. -I/usr/src/packages/BUILD/expect-0.3.3 -DPHP_ATOM_INC -I/usr/src/packages/BUILD/expect-0.3.3/include -I/usr/src/packages/BUILD/expect-0.3.3/main -I/usr/src/packages/BUILD/expect-0.3.3 -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /usr/src/packages/BUILD/expect-0.3.3/expect.c -o expect.lo 
[  131s] libtool: compile:  cc -I. -I/usr/src/packages/BUILD/expect-0.3.3 -DPHP_ATOM_INC -I/usr/src/packages/BUILD/expect-0.3.3/include -I/usr/src/packages/BUILD/expect-0.3.3/main -I/usr/src/packages/BUILD/expect-0.3.3 -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/src/packages/BUILD/expect-0.3.3/expect.c  -fPIC -DPIC -o .libs/expect.o
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c: In function 'OnSetExpectTimeout':
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:95: warning: passing argument 1 of 'atoi' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c: In function 'OnSetExpectMatchMax':
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:107: warning: passing argument 1 of 'atoi' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c: In function 'OnSetExpectLogUser':
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:120: warning: passing argument 2 of 'strncasecmp' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:121: warning: passing argument 2 of 'strncasecmp' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:122: warning: passing argument 2 of 'strncasecmp' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:123: warning: passing argument 2 of 'strncasecmp' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c: In function 'OnSetExpectLogFile':
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:142: error: 'new_value_length' undeclared (first use in this function)
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:142: error: (Each undeclared identifier is reported only once
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:142: error: for each function it appears in.)
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:143: warning: passing argument 1 of '_php_stream_open_wrapper_ex' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c: In function 'zif_expect_popen':
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:257: error: incompatible types in assignment
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c: In function 'zif_expect_expectl':
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:281: warning: passing argument 1 of 'zend_fetch_resource2_ex' from incompatible pointer type
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:283: error: wrong type argument to unary exclamation mark
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:298:74: error: macro "zend_hash_get_current_data" passed 2 arguments, but takes just 1
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:298: error: 'zend_hash_get_current_data' undeclared (first use in this function)
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:301:63: error: macro "zend_hash_get_current_key" passed 4 arguments, but takes just 3
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:301: error: 'zend_hash_get_current_key' undeclared (first use in this function)
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:313: warning: passing argument 1 of 'zend_hash_index_find' makes pointer from integer without a cast
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:313: error: too many arguments to function 'zend_hash_index_find'
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:323: warning: assignment makes pointer from integer without a cast
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:326: warning: passing argument 1 of 'zend_hash_index_find' makes pointer from integer without a cast
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:326: error: too many arguments to function 'zend_hash_index_find'
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:334: warning: passing argument 1 of 'zend_hash_index_find' makes pointer from integer without a cast
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:334: error: too many arguments to function 'zend_hash_index_find'
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:367: error: too many arguments to function 'add_index_string'
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:380: error: too many arguments to function 'add_next_index_string'
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:388: error: too many arguments to function 'zend_hash_index_find'
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:389: warning: passing argument 1 of 'zend_hash_index_find' makes pointer from integer without a cast
[  131s] /usr/src/packages/BUILD/expect-0.3.3/expect.c:389: error: too many arguments to function 'zend_hash_index_find'
[  131s] make: *** [expect.lo] Error 1


Patches

php7_expect (last revision 2017-05-31 12:08 UTC by danyi dot david at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-31 12:19 UTC] danyi dot david at gmail dot com
I've updated the code to reflect the php7 zend api changes, while trying to keep backward compatibility. I kinda took it for granted that it compiles on earlier versions, so didn't check that, only added a bunch of #if directives around the places that had to be changed.

This works for me on 7.1.5-1+deb.sury.org~xenial+2 without any issues so far, but I'm not even close to being an expert in c, so there might be some errors lurking around the code.

Parts could probably be rewritten, there are some macros for looping through hashes in php7 api now, so that part of the code is probably suboptimal, but refactoring the whole code to work with the new stuff was too far out of my reach.
 [2019-09-02 13:12 UTC] cmb@php.net
-Assigned To: +Assigned To: michael
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 13:01:28 2019 UTC