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 :
/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
@jpauli what is your plan for the PHP 7 migration of the extension ?
Other extensions I saw prefered creating a specific branch for PHP7 because it needs many more changes than previous versions.
There will be another branch I think, with a new code ; but not before PHP7 is released
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)
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.
You could also easily have 2 files, and just #include the right version.
Started the PHP7 port of Twig extension as an ext7/ directory like for Pimple.
You shoudl ping @fabpot for files organization, not me.
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
I'd love to see this too, any update @jpauli ?
This extension is not PHP 7 ready.
thanks for all your work, looking forward to enjoying the performance boost when it's ready :)
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 :)
+1
@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.
@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.
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.
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 look further down the thread, the author acknowledges his mistake, he couldn't compile the extension :p
:+1: 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 You should open an issue to blackfire to make them take into account that it is not yet rewritten for PHP 7.
@stof Done. They answered (wow, they are fast!) that they put it on todo list.
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 .. So it looks like this extension might not be needed under PHP 7 at all. Thanks for reporting.
... or it could be even faster with extension
Of course.. The issue calls for further testing.. Thanks for the efforts all.
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 Yes, the extension currently doesn't work with PHP 7.
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.
@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 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)
@stof Thanks, I've also just learned that I have to update/disable cache for my case.
thank you guys, it was that simple, new cache works simply perfect!
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.
@fabpot do you know when will it be ready for php 7?
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).
Most helpful comment
Ran some quick benchmark on my local machine using Docker.
Here's my results:
Maybe you want to have a look at
https://github.com/php7-extensions/ext-php7-testing/tree/master/twig
and run the tests yourself.