Back to index

php5  5.3.10
Functions
spl_engine.c File Reference
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "zend_interfaces.h"
#include "php_spl.h"
#include "spl_functions.h"
#include "spl_engine.h"
#include "spl_array.h"

Go to the source code of this file.

Functions

PHPAPI void spl_instantiate (zend_class_entry *pce, zval **object, int alloc TSRMLS_DC)
PHPAPI long spl_offset_convert_to_long (zval *offset TSRMLS_DC)

Function Documentation

PHPAPI void spl_instantiate ( zend_class_entry *  pce,
zval **  object,
int alloc  TSRMLS_DC 
)

Definition at line 35 of file spl_engine.c.

{
       if (alloc) {
              ALLOC_ZVAL(*object);
       }
       object_init_ex(*object, pce);
       Z_SET_REFCOUNT_PP(object, 1);
       Z_SET_ISREF_PP(object); /* check if this can be hold always */
}

Here is the caller graph for this function:

PHPAPI long spl_offset_convert_to_long ( zval *offset  TSRMLS_DC)

Definition at line 46 of file spl_engine.c.

{
       switch(Z_TYPE_P(offset)) {
       case IS_STRING:
              ZEND_HANDLE_NUMERIC(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, idx);
              break;
       case IS_DOUBLE:
       case IS_RESOURCE:
       case IS_BOOL:
       case IS_LONG:
              if (Z_TYPE_P(offset) == IS_DOUBLE) {
                     return (long)Z_DVAL_P(offset);
              } else {
                     return Z_LVAL_P(offset);
              }
       }
       return -1;
} 

Here is the caller graph for this function: