]> granicus.if.org Git - php/commitdiff
MFH: Dropped zend.ze1_compatibility_mode
authorFelipe Pena <felipe@php.net>
Tue, 18 Mar 2008 14:10:45 +0000 (14:10 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 18 Mar 2008 14:10:45 +0000 (14:10 +0000)
[DOC]

21 files changed:
NEWS
Zend/tests/bug30332.phpt [deleted file]
Zend/tests/bug31828.phpt [deleted file]
Zend/tests/bug32080.phpt [deleted file]
Zend/tests/bug32852.phpt [deleted file]
Zend/tests/bug33243.phpt [deleted file]
Zend/tests/bug34712.phpt [deleted file]
Zend/tests/bug34767.phpt [deleted file]
Zend/zend.c
Zend/zend_API.c
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_globals.h
Zend/zend_objects.c
Zend/zend_operators.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/dom/php_dom.c
ext/simplexml/simplexml.c
main/main.c

diff --git a/NEWS b/NEWS
index da0c28ca73ecc29854a018419990c56deff97256..11c63ba269fad90fe2a68fc72b4425848c08bff6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 20??, PHP 5.3.0
 - Removed the experimental RPL (master/slave) functions from mysqli. (Andrey)
+- Dropped zend.ze1_compatibility_mode (Dmitry)
 
 - Added concept of "delayed early binding" that allows opcode caches to perform
   class declaration (early and/or run-time binding) in exactly the same order
diff --git a/Zend/tests/bug30332.phpt b/Zend/tests/bug30332.phpt
deleted file mode 100644 (file)
index e247849..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
---TEST--
-Bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with array_push())
---INI--
-zend.ze1_compatibility_mode=on
-error_reporting=4095
---FILE--
-<?php
-class x { };
-
-$first = new x;
-$second = $first;
-$container = array();
-array_push($container, $first);
-
-$first->first = " im in the first";
-
-print_r($first);
-print_r($second);
-print_r($container);
-?>
---EXPECTF--
-Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 4
-
-Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 5
-
-Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 7
-x Object
-(
-    [first] =>  im in the first
-)
-x Object
-(
-)
-Array
-(
-    [0] => x Object
-        (
-        )
-
-)
diff --git a/Zend/tests/bug31828.phpt b/Zend/tests/bug31828.phpt
deleted file mode 100644 (file)
index a3cc454..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-Bug #31828 (Crash with zend.ze1_compatibility_mode=On)
---INI--
-zend.ze1_compatibility_mode=on
-error_reporting=4095
---FILE--
-<?php
-$o = new stdClass();
-$o->id = 77;
-$o->name = "Aerospace";
-$a[] = $o;
-$a = $a[0];
-print_r($a);
-?>
---EXPECTF--
-Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 2
-
-Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 5
-
-Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 6
-stdClass Object
-(
-    [id] => 77
-    [name] => Aerospace
-)
diff --git a/Zend/tests/bug32080.phpt b/Zend/tests/bug32080.phpt
deleted file mode 100644 (file)
index a96c8bf..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On)
---INI--
-zend.ze1_compatibility_mode=on
-error_reporting=4095
---FILE--
-<?php
-class test { }
-$t = new test;
-$t = $t; // gives segfault
-var_dump($t);
-?>
---EXPECTF--
-Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 3
-
-Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 5
-object(test)#%d (0) {
-}
diff --git a/Zend/tests/bug32852.phpt b/Zend/tests/bug32852.phpt
deleted file mode 100644 (file)
index 38cea6f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
---TEST--
-Bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On)
---INI--
-zend.ze1_compatibility_mode=on
-error_reporting=4095
---FILE--
-<?php
-class crashme {
-    private static $instance = null;
-
-    public function __construct() {
-        self::$instance = $this;
-    }
-
-    public function __destruct() {
-        echo "i'm called\n";
-    }
-
-    public static function singleton() {
-        if (!isset(self::$instance)) {
-            self::$instance = new crashme();
-        }
-        return self::$instance;
-    }
-}
-
-crashme::singleton();
-?>
---EXPECTF--
-Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 6
-i'm called
-
-Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 15
-i'm called
-
-Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 17
-i'm called
-i'm called
diff --git a/Zend/tests/bug33243.phpt b/Zend/tests/bug33243.phpt
deleted file mode 100755 (executable)
index bb5d77c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-Bug #33243 (ze1_compatibility_mode does not work as expected)
---INI--
-zend.ze1_compatibility_mode=1
-error_reporting=4095
---FILE--
-<?php
-$a->y->z = 0;
-$b = $a;      // should perform deep copy of $a
-$b->y->z = 1; // hence this should have no effect on $a
-var_dump($a);
-?>
---EXPECTF--
-Strict Standards: Creating default object from empty value in %sbug33243.php on line 2
-
-Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 3
-
-Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 5
-object(stdClass)#%d (1) {
-  ["y"]=>
-  object(stdClass)#%d (1) {
-    ["z"]=>
-    int(0)
-  }
-}
diff --git a/Zend/tests/bug34712.phpt b/Zend/tests/bug34712.phpt
deleted file mode 100755 (executable)
index 8176292..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
---TEST--
-Bug #34712 (zend.ze1_compatibility_mode = on segfault)
---INI--
-zend.ze1_compatibility_mode=1
-error_reporting=4095
---FILE--
-<?php
-class foo {
-       function foo(&$obj_ref) {
-               $this->bar = &$obj_ref;
-       }
-}              
-
-
-class bar {
-       function bar() {
-               $this->foo = new foo($this);
-       }
-}
-
-$test = new bar;
-echo "ok\n";
-?>
---EXPECTF--
-Strict Standards: Implicit cloning object of class 'foo' because of 'zend.ze1_compatibility_mode' in %sbug34712.php on line 11
-
-Strict Standards: Implicit cloning object of class 'bar' because of 'zend.ze1_compatibility_mode' in %sbug34712.php on line 15
-ok
diff --git a/Zend/tests/bug34767.phpt b/Zend/tests/bug34767.phpt
deleted file mode 100755 (executable)
index eaede24..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
---TEST--
-Bug #34767 (Zend Engine 1 Compatibility not copying objects correctly)
---INI--
-zend.ze1_compatibility_mode=1
-error_reporting=E_ALL | E_DEPRECATED | E_STRICT
---FILE--
-<?php
-$a->y = &new stdClass();
-print_r($a);
-$b = $a;
-$a->y->z = 1;
-print_r($b);
-?>
---EXPECTF--
-
-Deprecated: Assigning the return value of new by reference is deprecated in %sbug34767.php on line 2
-stdClass Object
-(
-    [y] => stdClass Object
-        (
-        )
-
-)
-
-Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug34767.php on line 4
-stdClass Object
-(
-    [y] => stdClass Object
-        (
-            [z] => 1
-        )
-
-)
index 97fe82080c6fa110d4418a6597919e26d03f8c19..1f1fa582c12de5a9d3aaff4fc56acb40bc55ba0a 100644 (file)
@@ -90,7 +90,6 @@ static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
 ZEND_INI_BEGIN()
        ZEND_INI_ENTRY("error_reporting",                               NULL,           ZEND_INI_ALL,           OnUpdateErrorReporting)
        STD_ZEND_INI_BOOLEAN("zend.enable_gc",                          "1",    ZEND_INI_ALL,           OnUpdateGCEnabled,      gc_enabled,     zend_gc_globals,        gc_globals)
-       STD_ZEND_INI_BOOLEAN("zend.ze1_compatibility_mode",     "0",    ZEND_INI_ALL,           OnUpdateBool,   ze1_compatibility_mode, zend_executor_globals,  executor_globals)
 ZEND_INI_END()
 
 
index cfa354a8d5c6c934a21923971a4b148f4e644563..9cc9b7d023ab8c81a8fb07d61677bcefabea6695 100644 (file)
@@ -153,34 +153,6 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
        while (param_count-->0) {
                zval **value = (zval**)(p-arg_count);
 
-               if (EG(ze1_compatibility_mode) &&
-                       Z_TYPE_PP(value) == IS_OBJECT &&
-                       !Z_ISREF_PP(value)
-               ) {
-                       zval *value_ptr;
-                       char *class_name;
-                       zend_uint class_name_len;
-                       int dup;
-
-                       dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC);
-
-                       ALLOC_ZVAL(value_ptr);
-                       *value_ptr = **value;
-                       INIT_PZVAL(value_ptr);
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-
-                       if (Z_OBJ_HANDLER_PP(value, clone_obj) == NULL) {
-                               zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", class_name);
-                       }
-
-                       if(!dup) {
-                               efree(class_name);
-                       }
-
-                       value_ptr->value.obj = Z_OBJ_HANDLER_PP(value, clone_obj)(*value TSRMLS_CC);
-                       zval_ptr_dtor(value);
-                       *value = value_ptr;
-               }
                *(argument_array++) = value;
                arg_count--;
        }
index 0d3b8450eb5f9920084b547b9574146a4bf9d7a7..40f6df7b5789342de84bdc01a422da4f71019eeb 100644 (file)
@@ -560,26 +560,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
        object = *object_ptr;
 
        /* separate our value if necessary */
-       if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
-               zval *orig_value = value;
-               char *class_name;
-               zend_uint class_name_len;
-               int dup;
-               
-               ALLOC_ZVAL(value);
-               *value = *orig_value;
-               Z_UNSET_ISREF_P(value);
-               Z_SET_REFCOUNT_P(value, 0);
-               dup = zend_get_object_classname(orig_value, &class_name, &class_name_len TSRMLS_CC);
-               if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
-                       zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-               }
-               zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);             
-               value->value.obj = Z_OBJ_HANDLER_P(orig_value, clone_obj)(orig_value TSRMLS_CC);
-               if(!dup)        {
-                       efree(class_name);
-               }
-       } else if (value_op->op_type == IS_TMP_VAR) {
+       if (value_op->op_type == IS_TMP_VAR) {
                zval *orig_value = value;
 
                ALLOC_ZVAL(value);
@@ -686,49 +667,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
                return variable_ptr;
        }
 
-       if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
-               char *class_name;
-               zend_uint class_name_len;
-               int dup;
-                       
-               dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
-  
-               if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
-                       zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-               } else if (PZVAL_IS_REF(variable_ptr)) {
-                       if (variable_ptr != value) {
-                               zend_uint refcount = Z_REFCOUNT_P(variable_ptr);
-                               garbage = *variable_ptr;
-                               *variable_ptr = *value;
-                               Z_SET_REFCOUNT_P(variable_ptr, refcount);
-                               Z_SET_ISREF_P(variable_ptr);
-                               zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                               variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
-                               zendi_zval_dtor(garbage);
-                               return variable_ptr;
-                       }
-               } else {
-                       if (variable_ptr != value) {
-                               Z_ADDREF_P(value);
-                               Z_DELREF_P(variable_ptr);
-                               if (Z_REFCOUNT_P(variable_ptr) == 0) {
-                                       zendi_zval_dtor(*variable_ptr);
-                               } else {
-                                       ALLOC_ZVAL(variable_ptr);
-                                       *variable_ptr_ptr = variable_ptr;
-                               }
-                               *variable_ptr = *value;
-                               INIT_PZVAL(variable_ptr);
-                               zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                               variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
-                               zval_ptr_dtor(&value);
-                       }
-               }
-               if (!dup) {
-                       efree(class_name);
-               }
-       } else if (PZVAL_IS_REF(variable_ptr)) {
+       if (PZVAL_IS_REF(variable_ptr)) {
                if (variable_ptr!=value) {
                        zend_uint refcount = Z_REFCOUNT_P(variable_ptr);
 
@@ -798,32 +737,9 @@ static inline void zend_receive(zval **variable_ptr_ptr, zval *value TSRMLS_DC)
 {
        zval *variable_ptr = *variable_ptr_ptr;
 
-       if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
-               char *class_name;
-               zend_uint class_name_len;
-               int dup;
-               dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
-               
-               if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
-                       zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-               } else {
-                       Z_DELREF_P(variable_ptr);
-                       ALLOC_ZVAL(variable_ptr);
-                       *variable_ptr_ptr = variable_ptr;
-                       *variable_ptr = *value;
-                       INIT_PZVAL(variable_ptr);
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                       variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
-               }
-               if (!dup) {
-                       efree(class_name);
-               }
-       } else {
-               Z_DELREF_P(variable_ptr);
-               *variable_ptr_ptr = value;
-               Z_ADDREF_P(value);
-       }
+       Z_DELREF_P(variable_ptr);
+       *variable_ptr_ptr = value;
+       Z_ADDREF_P(value);
 }
 
 /* Utility Functions for Extensions */
index 975bdc8ec0da5772465c4391ad472cceeecb93b2..147d98546b077f21ae02a766c597d2b80c9542df 100644 (file)
@@ -122,15 +122,8 @@ static inline int i_zend_is_true(zval *op)
                                                break;
                                        }
                                }
-                       
-                               if(EG(ze1_compatibility_mode)) {
-                                       result = (zend_hash_num_elements(Z_OBJPROP_P(op))?1:0);
-                               } else {
-                                       result = 1;
-                               }
-                       } else {
-                               result = 1;
                        }
+                       result = 1;
                        break;
                default:
                        result = 0;
index 3f646162a20e21088271678689a7a9f65dab871f..34b9957bb7e77ad0626ea33ee9db69ed943b2584 100644 (file)
@@ -425,11 +425,6 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
                TSRMLS_FETCH();
 
                if (Z_REFCOUNT_PP(zval_ptr) == 1) {
-                       if ((*zval_ptr)->type == IS_OBJECT) {
-                               if (EG(ze1_compatibility_mode)) {
-                                       return;
-                               }
-                       }
                        Z_UNSET_ISREF_PP(zval_ptr);
                }
 
index b387c5db1abe65046c1254c82cbacbb660f6d36b..0b6214ab1ec4fe490db1b33068e80f96b02909b3 100644 (file)
@@ -186,7 +186,6 @@ struct _zend_executor_globals {
        HashTable *in_autoload;
        zend_function *autoload_func;
        zend_bool full_tables_cleanup;
-       zend_bool ze1_compatibility_mode;
 
        /* for extended information support */
        zend_bool no_extensions;
index 5d131f10777f70221ab81923c008b0f8c49fb5a6..3dcc15eaaf6c9af0b6b18b9c397dab4f3a14523a 100644 (file)
@@ -140,33 +140,10 @@ ZEND_API zend_object *zend_objects_get_address(zval *zobject TSRMLS_DC)
        return (zend_object *)zend_object_store_get_object(zobject TSRMLS_CC);
 }
 
-static void zval_add_ref_or_clone(zval **p)
-{
-       if (Z_TYPE_PP(p) == IS_OBJECT && !PZVAL_IS_REF(*p)) {
-               TSRMLS_FETCH();
-
-               if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) {
-                       zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s",  Z_OBJCE_PP(p)->name);
-               } else {
-                       zval *orig = *p;
-
-                       ALLOC_ZVAL(*p);
-                       **p = *orig;
-                       INIT_PZVAL(*p);
-                       (*p)->value.obj = Z_OBJ_HT_PP(p)->clone_obj(orig TSRMLS_CC);
-               }
-       } else {
-               Z_ADDREF_PP(p);
-       }
-}
-
 ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC)
 {
-       if (EG(ze1_compatibility_mode)) {
-               zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref_or_clone, (void *) NULL /* Not used anymore */, sizeof(zval *));
-       } else {
-               zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *));
-       }
+       zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *));
+
        if (old_object->ce->clone) {
                zval *new_obj;
 
index 34736184c56902dde767b4cbf4e1a18925929026..542af1576f97b10b935887f80d6fc24a811b1991 100644 (file)
@@ -367,15 +367,8 @@ ZEND_API void convert_to_long_base(zval *op, int base)
                                if (Z_TYPE_P(op) == IS_LONG) {
                                        return;
                                }
-
-                               if (EG(ze1_compatibility_mode)) {
-                                       HashTable *ht = Z_OBJPROP_P(op);
-                                       if (ht) {
-                                               retval = (zend_hash_num_elements(ht)?1:0);
-                                       }
-                               } else {
-                                       zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name);
-                               }
+                               zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name);
+                               
                                zval_dtor(op);
                                ZVAL_LONG(op, retval);
                                return;
@@ -433,15 +426,7 @@ ZEND_API void convert_to_double(zval *op)
                                if (Z_TYPE_P(op) == IS_DOUBLE) {
                                        return;
                                }
-
-                               if (EG(ze1_compatibility_mode)) {
-                                       HashTable *ht = Z_OBJPROP_P(op);
-                                       if (ht) {
-                                               retval = (zend_hash_num_elements(ht)?1.0:0.0);
-                                       }
-                               } else {
-                                       zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name);
-                               }
+                               zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name);
 
                                zval_dtor(op);
                                ZVAL_DOUBLE(op, retval);
@@ -530,13 +515,6 @@ ZEND_API void convert_to_boolean(zval *op)
                                        return;
                                }
 
-                               if (EG(ze1_compatibility_mode)) {
-                                       HashTable *ht = Z_OBJPROP_P(op);
-                                       if (ht) {
-                                               retval = (zend_hash_num_elements(ht)?1:0);
-                                       }
-                               }
-
                                zval_dtor(op);
                                ZVAL_BOOL(op, retval);
                                break;
@@ -1565,15 +1543,7 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
                        break;
                case IS_OBJECT:
                        if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
-                               if (EG(ze1_compatibility_mode)) {
-                                       zend_compare_objects(result, op1, op2 TSRMLS_CC);
-                                       /* comparison returns 0 in case of equality and
-                                        * 1 in case of ineqaulity, we need to reverse it
-                                        */
-                                       Z_LVAL_P(result) = !Z_LVAL_P(result);
-                               } else {
-                                       Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2));
-                               }
+                               Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2));
                        } else {
                                Z_LVAL_P(result) = 0;
                        }
index e7b09e4bcbae13cd94f7c8a30e1e36b973275178..2d69256aa58af26519c150dcb2e41e6b39ba0719 100644 (file)
@@ -2322,25 +2322,7 @@ ZEND_VM_C_LABEL(return_by_value):
 
                retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
 
-               if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
-                       zval *ret;
-                       char *class_name;
-                       zend_uint class_name_len;
-                       int dup;
-
-                       ALLOC_ZVAL(ret);
-                       INIT_PZVAL_COPY(ret, retval_ptr);
-                       dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC);
-                       if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
-                               zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-                       }
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                       ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
-                       *EG(return_value_ptr_ptr) = ret;
-                       if (!dup) {
-                               efree(class_name);
-                       }
-               } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */
+               if (!IS_OP1_TMP_FREE()) { /* Not a temp var */
                        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
                            (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
                                zval *ret;
index 95bc66e9c837fc17eaa997233e17c22ecebca9f1..f6c3f6359da1fabf93e8dac73792b6b34fef8043 100644 (file)
@@ -1432,25 +1432,7 @@ return_by_value:
 
                retval_ptr = &opline->op1.u.constant;
 
-               if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
-                       zval *ret;
-                       char *class_name;
-                       zend_uint class_name_len;
-                       int dup;
-
-                       ALLOC_ZVAL(ret);
-                       INIT_PZVAL_COPY(ret, retval_ptr);
-                       dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC);
-                       if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
-                               zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-                       }
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                       ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
-                       *EG(return_value_ptr_ptr) = ret;
-                       if (!dup) {
-                               efree(class_name);
-                       }
-               } else if (!0) { /* Not a temp var */
+               if (!0) { /* Not a temp var */
                        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
                            (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
                                zval *ret;
@@ -4608,25 +4590,7 @@ return_by_value:
 
                retval_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-               if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
-                       zval *ret;
-                       char *class_name;
-                       zend_uint class_name_len;
-                       int dup;
-
-                       ALLOC_ZVAL(ret);
-                       INIT_PZVAL_COPY(ret, retval_ptr);
-                       dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC);
-                       if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
-                               zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-                       }
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                       ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
-                       *EG(return_value_ptr_ptr) = ret;
-                       if (!dup) {
-                               efree(class_name);
-                       }
-               } else if (!1) { /* Not a temp var */
+               if (!1) { /* Not a temp var */
                        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
                            (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
                                zval *ret;
@@ -7719,25 +7683,7 @@ return_by_value:
 
                retval_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
 
-               if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
-                       zval *ret;
-                       char *class_name;
-                       zend_uint class_name_len;
-                       int dup;
-
-                       ALLOC_ZVAL(ret);
-                       INIT_PZVAL_COPY(ret, retval_ptr);
-                       dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC);
-                       if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
-                               zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-                       }
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                       ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
-                       *EG(return_value_ptr_ptr) = ret;
-                       if (!dup) {
-                               efree(class_name);
-                       }
-               } else if (!0) { /* Not a temp var */
+               if (!0) { /* Not a temp var */
                        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
                            (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
                                zval *ret;
@@ -21409,25 +21355,7 @@ return_by_value:
 
                retval_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
 
-               if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
-                       zval *ret;
-                       char *class_name;
-                       zend_uint class_name_len;
-                       int dup;
-
-                       ALLOC_ZVAL(ret);
-                       INIT_PZVAL_COPY(ret, retval_ptr);
-                       dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC);
-                       if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
-                               zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s",  class_name);
-                       }
-                       zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
-                       ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
-                       *EG(return_value_ptr_ptr) = ret;
-                       if (!dup) {
-                               efree(class_name);
-                       }
-               } else if (!0) { /* Not a temp var */
+               if (!0) { /* Not a temp var */
                        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
                            (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
                                zval *ret;
index f854bafc72426e031bbb56696d0dbacc1b585788..eb7562a1b43fcc0916e08b18352e0df140dddf71 100644 (file)
@@ -69,7 +69,6 @@ zend_class_entry *dom_xpath_class_entry;
 zend_class_entry *dom_namespace_node_class_entry;
 
 zend_object_handlers dom_object_handlers;
-zend_object_handlers dom_ze1_object_handlers;
 
 static HashTable classes;
 
@@ -504,25 +503,13 @@ zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
        return retval;
 }
 
-
-zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC)
-{
-       php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name);
-       /* Return zobject->value.obj just to satisfy compiler */
-       return zobject->value.obj;
-}
-
 static const zend_function_entry dom_functions[] = {
        PHP_FE(dom_import_simplexml, NULL)
        {NULL, NULL, NULL}
 };
 
 static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
-       if (EG(ze1_compatibility_mode)) {
-               return &dom_ze1_object_handlers;
-       } else {
-               return &dom_object_handlers;
-       }
+       return &dom_object_handlers;
 }
 
 static const zend_module_dep dom_deps[] = {
@@ -561,13 +548,6 @@ PHP_MINIT_FUNCTION(dom)
        dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
        dom_object_handlers.has_property = dom_property_exists;
 
-       memcpy(&dom_ze1_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
-       dom_ze1_object_handlers.read_property = dom_read_property;
-       dom_ze1_object_handlers.write_property = dom_write_property;
-       dom_ze1_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
-       dom_ze1_object_handlers.clone_obj = dom_objects_ze1_clone_obj;
-       dom_ze1_object_handlers.has_property = dom_property_exists;
-
        zend_hash_init(&classes, 0, NULL, NULL, 1);
 
        INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
index f70efed3686899919490d6743c1894e6073cb31c..3df38f2a008f81f9e0dd8a955a857a2e4d7ea520 100644 (file)
@@ -1872,41 +1872,6 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */
 };
 /* }}} */
 
-static zend_object_handlers sxe_ze1_object_handlers = { /* {{{ */
-       ZEND_OBJECTS_STORE_HANDLERS,
-       sxe_property_read,
-       sxe_property_write,
-       sxe_dimension_read,
-       sxe_dimension_write,
-       sxe_property_get_adr,
-       sxe_get_value,                  /* get */
-       NULL,
-       sxe_property_exists,
-       sxe_property_delete,
-       sxe_dimension_exists,
-       sxe_dimension_delete,
-       sxe_get_properties,
-       NULL, /* zend_get_std_object_handlers()->get_method,*/
-       NULL, /* zend_get_std_object_handlers()->call_method,*/
-       NULL, /* zend_get_std_object_handlers()->get_constructor, */
-       NULL, /* zend_get_std_object_handlers()->get_class_entry,*/
-       NULL, /* zend_get_std_object_handlers()->get_class_name,*/
-       sxe_objects_compare,
-       sxe_object_cast,
-       sxe_count_elements,
-       sxe_get_debug_info
-};
-/* }}} */
-
-static zend_object_value sxe_object_ze1_clone(zval *zobject TSRMLS_DC) /* {{{ */
-{
-       php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name);
-       /* Return zobject->value.obj just to satisfy compiler */
-       /* FIXME: Should not be a fatal */
-       return zobject->value.obj;
-}
-/* }}} */
-
 /* {{{ sxe_object_clone()
  */
 static void
@@ -2044,11 +2009,7 @@ php_sxe_register_object(php_sxe_object *intern TSRMLS_DC)
        zend_object_value rv;
 
        rv.handle = zend_objects_store_put(intern, sxe_object_dtor, (zend_objects_free_object_storage_t)sxe_object_free_storage, sxe_object_clone TSRMLS_CC);
-       if (EG(ze1_compatibility_mode)) {
-               rv.handlers = (zend_object_handlers *) &sxe_ze1_object_handlers;
-       } else {
-               rv.handlers = (zend_object_handlers *) &sxe_object_handlers;
-       }
+       rv.handlers = (zend_object_handlers *) &sxe_object_handlers;
 
        return rv;
 }
@@ -2479,12 +2440,6 @@ PHP_MINIT_FUNCTION(simplexml)
        sxe_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry;
        sxe_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name;
 
-       sxe_ze1_object_handlers.get_method = zend_get_std_object_handlers()->get_method;
-       sxe_ze1_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor;
-       sxe_ze1_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry;
-       sxe_ze1_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name;
-       sxe_ze1_object_handlers.clone_obj = sxe_object_ze1_clone;
-
 #ifdef HAVE_SPL
        if (zend_get_module_started("spl") == SUCCESS) {
                PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU);
index 63e7bd126197d21e925f23fbe00e604d55f1d1c7..5b8e334ed88d8bdcc18cc2c2c19b599d473d5427 100644 (file)
@@ -1816,6 +1816,22 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
                return FAILURE;
        }
 
+       /* Check for deprecated directives */
+       {
+               static const char *directives[] = {
+                       "zend.ze1_compatibility_mode",
+                       NULL};
+               const char **p = directives;
+               long val;
+
+               while (*p) {
+                       if (cfg_get_long((char*)*p, &val) == SUCCESS && val) {
+                               zend_error(E_WARNING, "Directive '%s' is no longer supported in PHP 5.3 and greater", *p);
+                       }
+                       ++p;
+               }
+       }
+
        /* Register PHP core ini entries */
        REGISTER_INI_ENTRIES();