New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP7 support on Twig extension #1695

Closed
odoucet opened this Issue May 20, 2015 · 35 comments

Comments

Projects
None yet
@odoucet

odoucet commented May 20, 2015

I saw Twig extension is now tested against PHP7 but compile failed :

phpize-7.0.0
./configure --with-php-config=/usr/bin/php-config-7.0.0 --enable-twig
make

Leads to :

make
/bin/sh /usr/src/build/php/Twig/ext/twig/libtool --mode=compile cc  -I. -I/usr/src/build/php/Twig/ext/twig -DPHP_ATOM_INC -I/usr/src/build/php/Twig/ext/twig/include -I/usr/src/build/php/Twig/ext/twig/main -I/usr/src/build/php/Twig/ext/twig -I/usr/include/php/7.0.0/php -I/usr/include/php/7.0.0/php/main -I/usr/include/php/7.0.0/php/TSRM -I/usr/include/php/7.0.0/php/Zend -I/usr/include/php/7.0.0/php/ext -I/usr/include/php/7.0.0/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /usr/src/build/php/Twig/ext/twig/twig.c -o twig.lo
mkdir .libs
 cc -I. -I/usr/src/build/php/Twig/ext/twig -DPHP_ATOM_INC -I/usr/src/build/php/Twig/ext/twig/include -I/usr/src/build/php/Twig/ext/twig/main -I/usr/src/build/php/Twig/ext/twig -I/usr/include/php/7.0.0/php -I/usr/include/php/7.0.0/php/main -I/usr/include/php/7.0.0/php/TSRM -I/usr/include/php/7.0.0/php/Zend -I/usr/include/php/7.0.0/php/ext -I/usr/include/php/7.0.0/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/src/build/php/Twig/ext/twig/twig.c  -fPIC -DPIC -o .libs/twig.o
/usr/src/build/php/Twig/ext/twig/twig.c:23:40: error: ext/standard/php_smart_str.h: No such file or directory
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_ARRAY_KEY_EXISTS':
/usr/src/build/php/Twig/ext/twig/twig.c:100: warning: passing argument 2 of 'zend_hash_exists' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:157: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:100: error: too many arguments to function 'zend_hash_exists'
/usr/src/build/php/Twig/ext/twig/twig.c:102: error: 'IS_BOOL' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:102: error: (Each undeclared identifier is reported only once
/usr/src/build/php/Twig/ext/twig/twig.c:102: error: for each function it appears in.)
/usr/src/build/php/Twig/ext/twig/twig.c:110: warning: passing argument 2 of 'zend_symtable_exists' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:372: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:110: error: too many arguments to function 'zend_symtable_exists'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_INSTANCE_OF_USERLAND':
/usr/src/build/php/Twig/ext/twig/twig.c:128: warning: passing argument 1 of 'zend_lookup_class' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_execute.h:43: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:128: error: too many arguments to function 'zend_lookup_class'
/usr/src/build/php/Twig/ext/twig/twig.c:128: warning: comparison between pointer and integer
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_GET_ARRAYOBJECT_ELEMENT':
/usr/src/build/php/Twig/ext/twig/twig.c:141: warning: passing argument 1 of 'zend_call_method' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_interfaces.h:41: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:141: warning: passing argument 6 of 'zend_call_method' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_interfaces.h:41: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:143: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_ISSET_ARRAYOBJECT_ELEMENT':
/usr/src/build/php/Twig/ext/twig/twig.c:164: warning: passing argument 1 of 'zend_call_method' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_interfaces.h:41: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:164: warning: passing argument 6 of 'zend_call_method' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_interfaces.h:41: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:166: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:175: error: 'IS_BOOL' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_CALL_USER_FUNC_ARRAY':
/usr/src/build/php/Twig/ext/twig/twig.c:206: warning: passing argument 2 of 'zend_hash_get_current_data_ex' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:169: note: expected 'HashPosition *' but argument is of type 'void **'
/usr/src/build/php/Twig/ext/twig/twig.c:206: error: too many arguments to function 'zend_hash_get_current_data_ex'
/usr/src/build/php/Twig/ext/twig/twig.c:214:36: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c:214: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:217: error: incompatible types when assigning to type 'zval' from type 'struct zval *'
/usr/src/build/php/Twig/ext/twig/twig.c:220: error: 'zend_fcall_info' has no member named 'object_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:224: error: 'zend_fcall_info' has no member named 'retval_ptr_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:226: warning: assignment from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_CALL_BOOLEAN':
/usr/src/build/php/Twig/ext/twig/twig.c:248: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_GET_STATIC_PROPERTY':
/usr/src/build/php/Twig/ext/twig/twig.c:261: warning: assignment makes pointer from integer without a cast
/usr/src/build/php/Twig/ext/twig/twig.c:263: warning: passing argument 2 of 'zend_std_get_static_property' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_object_handlers.h:165: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:263: error: too many arguments to function 'zend_std_get_static_property'
/usr/src/build/php/Twig/ext/twig/twig.c:263: warning: assignment from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_GET_ARRAY_ELEMENT_ZVAL':
/usr/src/build/php/Twig/ext/twig/twig.c:284: warning: passing argument 2 of 'zend_hash_find' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:152: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:284: error: too many arguments to function 'zend_hash_find'
/usr/src/build/php/Twig/ext/twig/twig.c:287: error: 'IS_BOOL' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:291: error: too many arguments to function 'zend_hash_index_find'
/usr/src/build/php/Twig/ext/twig/twig.c:295: warning: passing argument 2 of 'zend_symtable_find' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:348: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:295: error: too many arguments to function 'zend_symtable_find'
/usr/src/build/php/Twig/ext/twig/twig.c:316:42: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_GET_ARRAY_ELEMENT':
/usr/src/build/php/Twig/ext/twig/twig.c:316: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:322: warning: passing argument 2 of 'zend_symtable_find' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:348: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:322: error: too many arguments to function 'zend_symtable_find'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_PROPERTY':
/usr/src/build/php/Twig/ext/twig/twig.c:334: error: too few arguments to function 'object->value.obj->handlers->read_property'
/usr/src/build/php/Twig/ext/twig/twig.c:338: error: 'zend_executor_globals' has no member named 'uninitialized_zval_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:375:40: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_PROPERTY_CHAR':
/usr/src/build/php/Twig/ext/twig/twig.c:375: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:390:31: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_CALL_S':
/usr/src/build/php/Twig/ext/twig/twig.c:390: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:394:34: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c:397: error: incompatible types when assigning to type 'zval' from type 'struct zval *'
/usr/src/build/php/Twig/ext/twig/twig.c:400: error: 'zend_fcall_info' has no member named 'object_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:404: error: 'zend_fcall_info' has no member named 'retval_ptr_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:406: warning: assignment from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c:411: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:415: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_CALL_SB':
/usr/src/build/php/Twig/ext/twig/twig.c:425: error: 'IS_BOOL' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:428: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:446:34: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_CALL_ZZ':
/usr/src/build/php/Twig/ext/twig/twig.c:446: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:449: error: incompatible types when assigning to type 'zval' from type 'struct zval *'
/usr/src/build/php/Twig/ext/twig/twig.c:452: error: 'zend_fcall_info' has no member named 'object_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:456: error: 'zend_fcall_info' has no member named 'retval_ptr_ptr'
/usr/src/build/php/Twig/ext/twig/twig.c:458: warning: assignment from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c:468: error: 'IS_BOOL' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:470: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_NEW':
/usr/src/build/php/Twig/ext/twig/twig.c:485: warning: passing argument 1 of 'zend_lookup_class' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_execute.h:43: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:485: error: too many arguments to function 'zend_lookup_class'
/usr/src/build/php/Twig/ext/twig/twig.c:485: warning: comparison between pointer and integer
/usr/src/build/php/Twig/ext/twig/twig.c:489: error: lvalue required as left operand of assignment
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'twig_add_array_key_to_string':
/usr/src/build/php/Twig/ext/twig/twig.c:506: error: 'smart_str' has no member named 'len'
/usr/src/build/php/Twig/ext/twig/twig.c:510: error: 'zend_hash_key' has no member named 'nKeyLength'
/usr/src/build/php/Twig/ext/twig/twig.c:515: error: 'zend_hash_key' has no member named 'arKey'
/usr/src/build/php/Twig/ext/twig/twig.c:515: error: 'zend_hash_key' has no member named 'nKeyLength'
/usr/src/build/php/Twig/ext/twig/twig.c:515: warning: passing argument 3 of 'php_addcslashes' from incompatible pointer type
/usr/include/php/7.0.0/php/ext/standard/php_string.h:127: note: expected 'char *' but argument is of type 'int *'
/usr/src/build/php/Twig/ext/twig/twig.c:515: error: too many arguments to function 'php_addcslashes'
/usr/src/build/php/Twig/ext/twig/twig.c:515: warning: assignment from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c:516: warning: assignment makes pointer from integer without a cast
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_IMPLODE_ARRAY_KEYS':
/usr/src/build/php/Twig/ext/twig/twig.c:528: warning: excess elements in struct initializer
/usr/src/build/php/Twig/ext/twig/twig.c:528: warning: (near initialization for 'collector')
/usr/src/build/php/Twig/ext/twig/twig.c:531: warning: passing argument 2 of 'zend_hash_apply_with_arguments' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:132: note: expected 'apply_func_args_t' but argument is of type 'int (*)(void *, int,  struct __va_list_tag *, struct zend_hash_key *)'
/usr/src/build/php/Twig/ext/twig/twig.c:534: error: 'smart_str' has no member named 'c'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_RUNTIME_ERROR':
/usr/src/build/php/Twig/ext/twig/twig.c:551: warning: passing argument 1 of 'zend_lookup_class' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_execute.h:43: note: expected 'struct zend_string *' but argument is of type 'char *'
/usr/src/build/php/Twig/ext/twig/twig.c:551: error: too many arguments to function 'zend_lookup_class'
/usr/src/build/php/Twig/ext/twig/twig.c:551: warning: comparison between pointer and integer
/usr/src/build/php/Twig/ext/twig/twig.c:570:69: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/usr/src/build/php/Twig/ext/twig/twig.c:570: error: 'ZVAL_STRINGL' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:571:33: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c:571: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:575:79: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/usr/src/build/php/Twig/ext/twig/twig.c:576: warning: passing argument 2 of 'call_user_function' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_API.h:469: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:581: warning: passing argument 2 of 'call_user_function' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_API.h:469: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:581: warning: passing argument 6 of 'call_user_function' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_API.h:469: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:583: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:584: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:585: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:586: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'TWIG_GET_CLASS_NAME':
/usr/src/build/php/Twig/ext/twig/twig.c:597: error: 'zend_uint' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:597: error: expected ';' before 'class_name_len'
/usr/src/build/php/Twig/ext/twig/twig.c:603: error: 'class_name_len' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'twig_add_method_to_class':
/usr/src/build/php/Twig/ext/twig/twig.c:624: warning: passing argument 1 of 'strlen' from incompatible pointer type
/usr/include/string.h:397: note: expected 'const char *' but argument is of type 'struct zend_string *'
/usr/src/build/php/Twig/ext/twig/twig.c:625: warning: passing argument 1 of '_estrndup' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_alloc.h:81: note: expected 'const char *' but argument is of type 'struct zend_string *'
/usr/src/build/php/Twig/ext/twig/twig.c:628: error: too many arguments to function 'add_assoc_stringl_ex'
/usr/src/build/php/Twig/ext/twig/twig.c:649:116: error: macro "zend_unmangle_property_name" passed 4 arguments, but takes just 3
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'twig_add_property_to_class':
/usr/src/build/php/Twig/ext/twig/twig.c:649: error: 'zend_unmangle_property_name' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:654:50: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/usr/src/build/php/Twig/ext/twig/twig.c:654: error: 'add_assoc_string' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'twig_add_class_to_cache':
/usr/src/build/php/Twig/ext/twig/twig.c:664: warning: assignment makes pointer from integer without a cast
/usr/src/build/php/Twig/ext/twig/twig.c:673: warning: passing argument 2 of 'zend_hash_apply_with_arguments' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:132: note: expected 'apply_func_args_t' but argument is of type 'int (*)(void *, int,  struct __va_list_tag *, struct zend_hash_key *)'
/usr/src/build/php/Twig/ext/twig/twig.c:674: warning: passing argument 2 of 'zend_hash_apply_with_arguments' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_hash.h:132: note: expected 'apply_func_args_t' but argument is of type 'int (*)(void *, int,  struct __va_list_tag *, struct zend_hash_key *)'
/usr/src/build/php/Twig/ext/twig/twig.c: In function 'zif_twig_template_get_attributes':
/usr/src/build/php/Twig/ext/twig/twig.c:752: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:831: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:872: warning: passing argument 1 of 'zval_get_type' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_types.h:312: note: expected 'const struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:872: warning: initialization from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c:872: warning: passing argument 1 of 'zval_get_type' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_types.h:312: note: expected 'const struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:872: warning: passing argument 1 of '_convert_to_string' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_operators.h:242: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:876: warning: passing argument 1 of 'zval_get_type' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_types.h:312: note: expected 'const struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:876: warning: initialization from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c:876: warning: passing argument 1 of 'zval_get_type' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_types.h:312: note: expected 'const struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:876: warning: passing argument 1 of '_convert_to_string' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_operators.h:242: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:881: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:1032:33: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/usr/src/build/php/Twig/ext/twig/twig.c:1032: error: 'ZVAL_STRING' undeclared (first use in this function)
/usr/src/build/php/Twig/ext/twig/twig.c:1036: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:1056: warning: passing argument 1 of 'TWIG_INSTANCE_OF' from incompatible pointer type
/usr/src/build/php/Twig/ext/twig/twig.c:114: note: expected 'struct zval *' but argument is of type 'struct zend_object *'
/usr/src/build/php/Twig/ext/twig/twig.c:1086: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:1088: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
/usr/src/build/php/Twig/ext/twig/twig.c:1096: warning: passing argument 1 of '_zval_ptr_dtor' from incompatible pointer type
/usr/include/php/7.0.0/php/Zend/zend_variables.h:111: note: expected 'struct zval *' but argument is of type 'struct zval **'
make: *** [twig.lo] Error 1
@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof May 20, 2015

Contributor

@jpauli what is your plan for the PHP 7 migration of the extension ?

Contributor

stof commented May 20, 2015

@jpauli what is your plan for the PHP 7 migration of the extension ?

@odoucet

This comment has been minimized.

Show comment
Hide comment
@odoucet

odoucet May 20, 2015

Other extensions I saw prefered creating a specific branch for PHP7 because it needs many more changes than previous versions.

odoucet commented May 20, 2015

Other extensions I saw prefered creating a specific branch for PHP7 because it needs many more changes than previous versions.

@jpauli

This comment has been minimized.

Show comment
Hide comment
@jpauli

jpauli May 20, 2015

Contributor

There will be another branch I think, with a new code ; but not before PHP7 is released

Contributor

jpauli commented May 20, 2015

There will be another branch I think, with a new code ; but not before PHP7 is released

@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof Jul 3, 2015

Contributor

the issue with a different branch is that the Twig C extension lives inside the Twig repository. So creating a different branch for PHP 7 would mean creating a different version of Twig for the PHP 7 support, which would be a maintenance nightmare for the library (especially given that the PHP code is already compatible with PHP 7 in the same codebase)

Contributor

stof commented Jul 3, 2015

the issue with a different branch is that the Twig C extension lives inside the Twig repository. So creating a different branch for PHP 7 would mean creating a different version of Twig for the PHP 7 support, which would be a maintenance nightmare for the library (especially given that the PHP code is already compatible with PHP 7 in the same codebase)

@tsteur tsteur referenced this issue Sep 2, 2015

Closed

Full PHP7 compatibility #8689

10 of 11 tasks complete
@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Sep 9, 2015

Contributor

Maybe the C extension should get its own repo? If not the only option is to use a big #ifdef and have both sources in the same file.

Contributor

acasademont commented Sep 9, 2015

Maybe the C extension should get its own repo? If not the only option is to use a big #ifdef and have both sources in the same file.

@hanikesn

This comment has been minimized.

Show comment
Hide comment
@hanikesn

hanikesn Sep 9, 2015

You could also easily have 2 files, and just #include the right version.

hanikesn commented Sep 9, 2015

You could also easily have 2 files, and just #include the right version.

@jpauli

This comment has been minimized.

Show comment
Hide comment
@jpauli

jpauli Sep 11, 2015

Contributor

Started the PHP7 port of Twig extension as an ext7/ directory like for Pimple.
You shoudl ping @fabpot for files organization, not me.

Contributor

jpauli commented Sep 11, 2015

Started the PHP7 port of Twig extension as an ext7/ directory like for Pimple.
You shoudl ping @fabpot for files organization, not me.

@jhedstrom

This comment has been minimized.

Show comment
Hide comment
@jhedstrom

jhedstrom Dec 4, 2015

Any word on this?

I see this error on PHP7 when trying to compile:

/Twig/ext/twig/twig.c:23:40: fatal error: ext/standard/php_smart_str.h: No such file or directory
 #include "ext/standard/php_smart_str.h"
                                        ^
compilation terminated.
make: *** [twig.lo] Error 1

jhedstrom commented Dec 4, 2015

Any word on this?

I see this error on PHP7 when trying to compile:

/Twig/ext/twig/twig.c:23:40: fatal error: ext/standard/php_smart_str.h: No such file or directory
 #include "ext/standard/php_smart_str.h"
                                        ^
compilation terminated.
make: *** [twig.lo] Error 1
@peteward

This comment has been minimized.

Show comment
Hide comment
@peteward

peteward Dec 6, 2015

I'd love to see this too, any update @jpauli ?

peteward commented Dec 6, 2015

I'd love to see this too, any update @jpauli ?

@jpauli

This comment has been minimized.

Show comment
Hide comment
@jpauli

jpauli Dec 6, 2015

Contributor

This extension is not PHP 7 ready.

Contributor

jpauli commented Dec 6, 2015

This extension is not PHP 7 ready.

@peteward

This comment has been minimized.

Show comment
Hide comment
@peteward

peteward Dec 6, 2015

thanks for all your work, looking forward to enjoying the performance boost when it's ready :)

peteward commented Dec 6, 2015

thanks for all your work, looking forward to enjoying the performance boost when it's ready :)

@iler

This comment has been minimized.

Show comment
Hide comment
@iler

iler Jan 13, 2016

I see that part of the PHP 7 tests are still failing so how far are we from having working version for PHP 7? Really looking forward for having this for PHP 7 too :)

iler commented Jan 13, 2016

I see that part of the PHP 7 tests are still failing so how far are we from having working version for PHP 7? Really looking forward for having this for PHP 7 too :)

@onlime

This comment has been minimized.

Show comment
Hide comment
@onlime

onlime commented Jan 13, 2016

+1

@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof Jan 13, 2016

Contributor

@iler the C extension is not compatible with PHP 7 (it cannot even compile). Twig itself it fully compatible with PHP 7 (and I don't see any failing test there).
Regarding the C extension, the first thing to investigate for PHP 7 would be whether we still need the performance improvements it brings on PHP 5 (given the improvements done in PHP 7 itself).
Supporting the extension on PHP 7 means rewriting the extension for PHP 7.

Contributor

stof commented Jan 13, 2016

@iler the C extension is not compatible with PHP 7 (it cannot even compile). Twig itself it fully compatible with PHP 7 (and I don't see any failing test there).
Regarding the C extension, the first thing to investigate for PHP 7 would be whether we still need the performance improvements it brings on PHP 5 (given the improvements done in PHP 7 itself).
Supporting the extension on PHP 7 means rewriting the extension for PHP 7.

@iler

This comment has been minimized.

Show comment
Hide comment
@iler

iler Jan 13, 2016

@stof that's great to hear! However I'm as interested of the C extension performance benefits as of Twig itself so the investigation regarding performance in PHP 7 is also important.

iler commented Jan 13, 2016

@stof that's great to hear! However I'm as interested of the C extension performance benefits as of Twig itself so the investigation regarding performance in PHP 7 is also important.

@stephanvierkant

This comment has been minimized.

Show comment
Hide comment
@stephanvierkant

stephanvierkant Jan 24, 2016

It looks like Drupal's performance increased with the Twig C extension on PHP 5.5, but some people doubt if there is any reasonable difference on newer PHP versions: https://www.drupal.org/node/2568247

Will the C extension make rendering even faster on PHP 7? Maybe PHP 7 support isn't necessary anymore.

stephanvierkant commented Jan 24, 2016

It looks like Drupal's performance increased with the Twig C extension on PHP 5.5, but some people doubt if there is any reasonable difference on newer PHP versions: https://www.drupal.org/node/2568247

Will the C extension make rendering even faster on PHP 7? Maybe PHP 7 support isn't necessary anymore.

@cdaguerre

This comment has been minimized.

Show comment
Hide comment
@cdaguerre

cdaguerre Mar 3, 2016

Not sure whether it's a mistake or not, but it seems someone managed to compile PHP7 with the twig C extension to make this benchmark.

cdaguerre commented Mar 3, 2016

Not sure whether it's a mistake or not, but it seems someone managed to compile PHP7 with the twig C extension to make this benchmark.

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Mar 3, 2016

Contributor

@cdaguerre look further down the thread, the author acknowledges his mistake, he couldn't compile the extension :p

Contributor

acasademont commented Mar 3, 2016

@cdaguerre look further down the thread, the author acknowledges his mistake, he couldn't compile the extension :p

@JHGitty

This comment has been minimized.

Show comment
Hide comment
@JHGitty

JHGitty Mar 24, 2016

👍 Please add support for PHP7 to the Twig C extension. blackfire.io suggests it but I cannot find a way to add it for our PHP7 usage.

JHGitty commented Mar 24, 2016

👍 Please add support for PHP7 to the Twig C extension. blackfire.io suggests it but I cannot find a way to add it for our PHP7 usage.

@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof Mar 24, 2016

Contributor

@JHGitty You should open an issue to blackfire to make them take into account that it is not yet rewritten for PHP 7.

Contributor

stof commented Mar 24, 2016

@JHGitty You should open an issue to blackfire to make them take into account that it is not yet rewritten for PHP 7.

@JHGitty

This comment has been minimized.

Show comment
Hide comment
@JHGitty

JHGitty Mar 24, 2016

@stof Done. They answered (wow, they are fast!) that they put it on todo list.

JHGitty commented Mar 24, 2016

@stof Done. They answered (wow, they are fast!) that they put it on todo list.

@mre

This comment has been minimized.

Show comment
Hide comment
@mre

mre Apr 4, 2016

Ran some quick benchmark on my local machine using Docker.
Here's my results:

PHP 5.6                      14.599s
PHP 5.6 + twig extension     12.361s
PHP 7                         5.224s

Maybe you want to have a look at
https://github.com/php7-extensions/ext-php7-testing/tree/master/twig
and run the tests yourself.

mre commented Apr 4, 2016

Ran some quick benchmark on my local machine using Docker.
Here's my results:

PHP 5.6                      14.599s
PHP 5.6 + twig extension     12.361s
PHP 7                         5.224s

Maybe you want to have a look at
https://github.com/php7-extensions/ext-php7-testing/tree/master/twig
and run the tests yourself.

@acrolink

This comment has been minimized.

Show comment
Hide comment
@acrolink

acrolink Apr 4, 2016

@mre .. So it looks like this extension might not be needed under PHP 7 at all. Thanks for reporting.

acrolink commented Apr 4, 2016

@mre .. So it looks like this extension might not be needed under PHP 7 at all. Thanks for reporting.

@soukicz

This comment has been minimized.

Show comment
Hide comment
@soukicz

soukicz Apr 4, 2016

... or it could be even faster with extension

soukicz commented Apr 4, 2016

... or it could be even faster with extension

@acrolink

This comment has been minimized.

Show comment
Hide comment
@acrolink

acrolink Apr 4, 2016

Of course.. The issue calls for further testing.. Thanks for the efforts all.

acrolink commented Apr 4, 2016

Of course.. The issue calls for further testing.. Thanks for the efforts all.

@profuel

This comment has been minimized.

Show comment
Hide comment
@profuel

profuel Jun 14, 2016

hello, guys!
Am I right saying that I cannot get Twig extension working with php7?
I tried to compile, but getting:
twig/twig/ext/twig/twig.c:23:40: fatal error: ext/standard/php_smart_str.h: No such file or directory

profuel commented Jun 14, 2016

hello, guys!
Am I right saying that I cannot get Twig extension working with php7?
I tried to compile, but getting:
twig/twig/ext/twig/twig.c:23:40: fatal error: ext/standard/php_smart_str.h: No such file or directory

@xabbuh

This comment has been minimized.

Show comment
Hide comment
@xabbuh

xabbuh Jun 14, 2016

Contributor

@profuel Yes, the extension currently doesn't work with PHP 7.

Contributor

xabbuh commented Jun 14, 2016

@profuel Yes, the extension currently doesn't work with PHP 7.

@mre

This comment has been minimized.

Show comment
Hide comment
@mre

mre Jun 14, 2016

You might want to benchmark if you really need the extension on PHP7 or if you can live without.
At trivago we run PHP7 without the twig extension and we achieved 100ms backend response times nevertheless.

mre commented Jun 14, 2016

You might want to benchmark if you really need the extension on PHP7 or if you can live without.
At trivago we run PHP7 without the twig extension and we achieved 100ms backend response times nevertheless.

@profuel

This comment has been minimized.

Show comment
Hide comment
@profuel

profuel Jun 14, 2016

@xabbuh Thanks for fast response.
@mre thanks for your experience. I have to learn how to live without extension, since I'm getting error in compiled files about missing function twig_template_get_attributes

profuel commented Jun 14, 2016

@xabbuh Thanks for fast response.
@mre thanks for your experience. I have to learn how to live without extension, since I'm getting error in compiled files about missing function twig_template_get_attributes

@stof

This comment has been minimized.

Show comment
Hide comment
@stof

stof Jun 14, 2016

Contributor

@profuel clear your cache to recompile templates without the extension (btw, recent versions of Twig use different cache keys depending on whether the extension is there or no)

Contributor

stof commented Jun 14, 2016

@profuel clear your cache to recompile templates without the extension (btw, recent versions of Twig use different cache keys depending on whether the extension is there or no)

@profuel

This comment has been minimized.

Show comment
Hide comment
@profuel

profuel Jun 14, 2016

@stof Thanks, I've also just learned that I have to update/disable cache for my case.

profuel commented Jun 14, 2016

@stof Thanks, I've also just learned that I have to update/disable cache for my case.

@profuel

This comment has been minimized.

Show comment
Hide comment
@profuel

profuel Jun 14, 2016

thank you guys, it was that simple, new cache works simply perfect!

profuel commented Jun 14, 2016

thank you guys, it was that simple, new cache works simply perfect!

@anavarre

This comment has been minimized.

Show comment
Hide comment
@anavarre

anavarre Jul 8, 2016

FTR Drupal 8.2.x is no longer recommending the Twig C extension by lack of evidence it's still useful for modern PHP versions. See https://www.drupal.org/node/2568247 for details. We'll revisit if there's any evidence (via benchmarking, most likely) we should add it back.

anavarre commented Jul 8, 2016

FTR Drupal 8.2.x is no longer recommending the Twig C extension by lack of evidence it's still useful for modern PHP versions. See https://www.drupal.org/node/2568247 for details. We'll revisit if there's any evidence (via benchmarking, most likely) we should add it back.

@bmxlugo

This comment has been minimized.

Show comment
Hide comment
@bmxlugo

bmxlugo Dec 21, 2016

@fabpot do you know when will it be ready for php 7?

bmxlugo commented Dec 21, 2016

@fabpot do you know when will it be ready for php 7?

@fabpot

This comment has been minimized.

Show comment
Hide comment
@fabpot

fabpot Dec 21, 2016

Contributor

No ETA, but that would be a great Christmas present :) closing this issue as we now have a PR that moves the min PHP version to PHP 7 (that's where Santa Claus could drop something soon).

Contributor

fabpot commented Dec 21, 2016

No ETA, but that would be a great Christmas present :) closing this issue as we now have a PR that moves the min PHP version to PHP 7 (that's where Santa Claus could drop something soon).

@fabpot fabpot closed this Dec 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment