CONFIG.M4
PHP_ARG_ENABLE(sample,
[Whether to enable the "sample" extension],
[ enablesample Enable "sample" extension support])
if test $PHP_SAMPLE != "no"; then
PHP_SUBST(SAMPLE_SHARED_LIBADD)
PHP_NEW_EXTENSION(sample, sample.c, $ext_shared)
fi
Makefile
5 . 2
TESTS
=====================================================================
TEST RESULT SUMMARY
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Exts skipped : 0
Exts tested : 26
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Number of tests : 1 1
Tests skipped : 0 ( 0.0%) ‐‐‐‐‐‐‐‐
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 1 (100.0%) (100.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Time taken : 1 seconds
=====================================================================
=====================================================================
FAILED TEST SUMMARY
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Call function with string argument [tests/001.phpt]
=====================================================================
6 . 6
Slide 20
Slide 20 text
FEEDBACK TO PHP QA
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to qa‐[email protected]
Do you want to send this report now? [Yns]:
> export NO_INTERACTION=1
6 . 7
GET THE TYPE
switch (Z_TYPE_P(value)) {
case IS_NULL :
php_printf("NULL");
break;
case IS_TRUE :
php_printf("Boolean: TRUE");
break;
case IS_FALSE :
php_printf("Boolean: FALSE");
break;
C
14 . 3
Slide 66
Slide 66 text
CONVERT
case IS_LONG :
convert_to_string(value);
php_printf("Integer: %s", Z_STRVAL_P(value));
break;
C
14 . 4
Slide 67
Slide 67 text
Z_*VAL_P
case IS_DOUBLE :
php_printf("Float: %f", Z_DVAL_P(value));
break;
case IS_STRING :
php_printf("String: %s", Z_STRVAL_P(value));
break;
case IS_RESOURCE :
php_printf("Resource: #%ld", Z_RESVAL_P(value));
break;
C
14 . 5
Slide 68
Slide 68 text
MORE TEMPLATES
Zend/zend_types.h
Zend/zend_operators.h
14 . 6
MORE ABOUT ZVAL
https://nikic.github.io/2015/05/05/Internal-value-
representation-in-PHP-7-part-1.html
http://jpauli.github.io/2016/01/14/php-7-objects.html
15 . 5
Slide 74
Slide 74 text
FUNCTION ARGUMENT: ARRAY
echo \sample\hello(['World', 'Universe']);
PHP
16 . 1