#include "php_propro.h"
-typedef int STATUS;
+#if PHP_VERSION_ID < 50500
+typedef enum {
+ SUCCESS = 0,
+ FAILURE = -1
+} ZEND_RESULT_CODE;
+#endif
#define DEBUG_PROPRO 0
static zval *get_parent_proxied_value(zval *object TSRMLS_DC);
static zval *get_proxied_value(zval *object TSRMLS_DC);
static zval *read_dimension(zval *object, zval *offset, int type TSRMLS_DC);
-static STATUS cast_proxied_value(zval *object, zval *return_value,
+static ZEND_RESULT_CODE cast_proxied_value(zval *object, zval *return_value,
int type TSRMLS_DC);
static void write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC);
static void set_proxied_value(zval **object, zval *value TSRMLS_DC);
{
zval **hash_value, *value = NULL;
php_property_proxy_object_t *obj;
- STATUS rv;
+ ZEND_RESULT_CODE rv;
obj = zend_object_store_get_object(object TSRMLS_CC);
debug_propro(1, "get", object, NULL, NULL TSRMLS_CC);
return value;
}
-static STATUS cast_proxied_value(zval *object, zval *return_value,
+static ZEND_RESULT_CODE cast_proxied_value(zval *object, zval *return_value,
int type TSRMLS_DC)
{
zval *proxied_value;
if (BP_VAR_R == type && proxied_value) {
if (Z_TYPE_P(proxied_value) == IS_ARRAY) {
zval **hash_value;
- STATUS rv = zend_symtable_find(Z_ARRVAL_P(proxied_value),
+ ZEND_RESULT_CODE rv = zend_symtable_find(Z_ARRVAL_P(proxied_value),
Z_STRVAL_P(o), Z_STRLEN_P(o), (void *) &hash_value);
if (SUCCESS == rv) {
if (Z_TYPE_P(proxied_value) == IS_ARRAY) {
zval **zentry;
- STATUS rv = zend_symtable_find(Z_ARRVAL_P(proxied_value), Z_STRVAL_P(o), Z_STRLEN_P(o) + 1, (void *) &zentry);
+ ZEND_RESULT_CODE rv = zend_symtable_find(Z_ARRVAL_P(proxied_value), Z_STRVAL_P(o), Z_STRLEN_P(o) + 1, (void *) &zentry);
if (SUCCESS != rv) {
exists = 0;
if (proxied_value && Z_TYPE_P(proxied_value) == IS_ARRAY) {
zval *o = offset;
- STATUS rv;
+ ZEND_RESULT_CODE rv;
convert_to_string_ex(&o);
rv = zend_symtable_del(Z_ARRVAL_P(proxied_value), Z_STRVAL_P(o),