PHP/Linux for +10 years • eZ Publish core developer • Author of the APM PHP extension • @patrick_allaert • [email protected] • http://github.com/patrickallaert/ • http://patrickallaert.blogspot.com/
for 10gen (the MongoDB people), where I also work on the MongoDB PHP driver. • Author of Xdebug • Author of the mcrypt, input_filter, dbus, translit and date/time extensions
as a string composed of characters having all a special meaning. • To mark the start of optional parameter(s), a pipe (“|”) character is used. Type Cod e Variable type Boolean b zend_bool Long l long Double d double String s char *, int (length) Path p char *, int (length) Class name C zend_class_entry* Resource r zval* Array a zval* Object o zval* zval z zval* Zval pointer Z zval** Callback f zend_fcall_info, zend_fcall_info_cache
to a zval: zval *val; • Use “z” with zend_parse_parameters() • Switch/case based on the type of val (Z_TYPE_P(uservar)) • Use php_printf() to print, except for strings from zval, since they may contain NULL characters: PHPWRITE(const char *, size_t);
ones) let you do stuff at specific moments of the PHP life cycles: • PHP_MINIT_FUNCTION • PHP_MSHUTDOWN_FUNCTION • PHP_RINIT_FUNCTION • PHP_RSHUTDOWN_FUNCTION
be made from a C type: • zend_declare_class_constant_null(); • zend_declare_class_constant_long(); • zend_declare_class_constant_bool(); • zend_declare_class_constant_double(); • zend_declare_class_constant_stringl(); • zend_declare_class_constant_string(); • Or from a zval: • zend_declare_class_constant();
made from a C type: • zend_declare_property_long(); • zend_declare_property_bool(); • zend_declare_property_double(); • zend_declare_property_stringl(); • zend_declare_property_string(); • Or from a zval: • zend_declare_property(); • Visibility: • ZEND_ACC_PUBLIC, ZEND_ACC_PROTECTED, ZEND_ACC_PRIVATE • Modifiers: • ZEND_ACC_STATIC, ZEND_ACC_ABSTRACT, ZEND_ACC_FINAL