Variables

void zval_add_ref(zval **ppzval);

Increases the refcount of ppzval. This function is identical to the command: (*ppzval)->refcount++; Like the other accessor functions and macros, its use is encouraged over direct access of the zvals in order to ensure maximum forward compatibility.

void zval_copy_ctor(zval *zvalue);

Duplicates all of a zval's internal structures. This command typically follows copying one zval's contents into another. Refer to Chapter 8 for a detailed use of this API call.

void zval_ptr_dtor(zval **zval_ptr);

Decreases a zval's refcount by one. If the refcount reaches zero, the internal structures of the zval are destroyed by automatically calling through to zval_dtor(*zval_ptr);.

After the internal structures are destroyed, efree(*zval_ptr); is called to destroy the zval container as well.

void zval_dtor(zval *zvalue);

Frees all of a zval's associated internal structures regardless of refcount. For example, an IS_STRING variable would have efree(Z_STRVAL_P(zvalue)); called.

char *zend_zval_type_name(zval *arg);

Translates a zval's numeric type identifier into a human readable name. For example, if arg is an IS_LONG zval, this function will return "integer".

int zend_is_true(zval *arg);

Tests the passed arg for truthness. As in, if this variable were used in a userspace conditional statement, would it yield a net result of trUE or FALSE? False values may occur from IS_NULL variables as well as literal Boolean FALSE values, or numeric values of 0 or 0.0. Empty strings, empty arrays, and a few specially designed objects can also result in a net-false value.

int zend_register_auto_global(char *name, uint name_len,
 zend_auto_global_callback callback TSRMLS_DC);

Register an auto (super) global variable. Any variable named here will automatically resolve itself to the global scope as if it were accessed as $GLOBALS['name'].

Argument

Purpose

name

NULL-terminated, case-sensitive variable name to be autogloballed.

name_len

Length of name excluding the trailing NULL.

callback

Compiler hook to execute additional code when an autoglobal variable is used in a compiled script. Refer to Chapter 12 for more information.



The PHP Life Cycle

Variables from the Inside Out

Memory Management

Setting Up a Build Environment

Your First Extension

Returning Values

Accepting Parameters

Working with Arrays and HashTables

The Resource Data Type

PHP4 Objects

PHP5 Objects

Startup, Shutdown, and a Few Points in Between

INI Settings

Accessing Streams

Implementing Streams

Diverting the Stream

Configuration and Linking

Extension Generators

Setting Up a Host Environment

Advanced Embedding

Appendix A. A Zend API Reference

Appendix B. PHPAPI

Appendix C. Extending and Embedding Cookbook

Appendix D. Additional Resources



Extending and Embedding PHP
Extending and Embedding PHP
ISBN: 067232704X
EAN: 2147483647
Year: 2007
Pages: 175
Authors: Sara Golemon

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net