]> granicus.if.org Git - php/commitdiff
- Change E_COMPILE_ERROR to E_WARNING (for wrong visibility on magic methods)
authorFelipe Pena <felipe@php.net>
Tue, 10 Jun 2008 23:09:09 +0000 (23:09 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 10 Jun 2008 23:09:09 +0000 (23:09 +0000)
Zend/tests/magic_methods_002.phpt
Zend/tests/magic_methods_003.phpt
Zend/tests/magic_methods_004.phpt
Zend/tests/magic_methods_005.phpt
Zend/tests/magic_methods_006.phpt
Zend/tests/magic_methods_007.phpt
Zend/tests/magic_methods_008.phpt
Zend/tests/magic_methods_009.phpt
Zend/tests/magic_methods_010.phpt
Zend/zend_compile.c

index da29aaa3a01cfc3c043a6f52cf0a2781a5db4a3c..1e8305e23769a6f23a67cc254d58e160d74d0a79 100644 (file)
@@ -11,4 +11,4 @@ class foo {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __unset() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __unset() must have public visibility and can not be static in %s on line %d
index 25802223c44be024d14690a2bb13454bc26faed8..1118a23ba0527d45454fd18730054eb23a4ba783 100644 (file)
@@ -11,4 +11,4 @@ class foo {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __unset() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __unset() must have public visibility and can not be static in %s on line %d
index c75e454395020f98f0d4fa227a6deef8f58857c5..0ac332cb3619f35e9ef1be369c29cd0732f198da 100644 (file)
@@ -11,4 +11,4 @@ class foo {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __unset() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __unset() must have public visibility and can not be static in %s on line %d
index 2cf84dc997698a7f4daeac38115f6aa18616a4da..8e8bb4e8a2730416562117bab9be0500d05c62d6 100644 (file)
@@ -9,4 +9,4 @@ interface a {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __call() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __call() must have public visibility and can not be static in %s on line %d
index 3fdab062b0adfc02ec07f49331f270997921e868..2e84a41c5cc3f4d086a42b532d971cd72c29ec15 100644 (file)
@@ -9,4 +9,4 @@ interface a {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __callStatic() must have public visibility and be static in %s on line %d
+Warning: The magic method __callStatic() must have public visibility and be static in %s on line %d
index 0f3b9e521dad563f2d970152477a11bd6c12e970..d949c95aeccebfa7f694c59440774ec50294b1f0 100644 (file)
@@ -9,4 +9,6 @@ abstract class b {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __set() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __set() must have public visibility and can not be static in %s on line %d
+
+Fatal error: Method b::__set() must take exactly 2 arguments in %s on line %d
index b3f73624939b25b017703ab01ed513ccab8b0e7f..3d9b69728d290c2ff82511a25f81c64d47242004 100644 (file)
@@ -14,4 +14,6 @@ class a extends b {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __set() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __set() must have public visibility and can not be static in %s on line %d
+
+Fatal error: Access level to a::__set() must be public (as in class b) in %s on line %d
index aac3d4c6ca468a5e7301a7dbb89285eaf933742f..2b514c3bfff9786d43dfe9330effdd2a77d154ed 100644 (file)
@@ -10,4 +10,4 @@ class a {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __callStatic() must have public visibility and be static in %s on line %d
+Warning: The magic method __callStatic() must have public visibility and be static in %s on line %d
index 33e6b873ff8deeec97d2b4f38595f167748db4f8..d50b357242c11bd744d77ae28b506bf81fc0d52f 100644 (file)
@@ -10,4 +10,6 @@ class a {
 
 ?>
 --EXPECTF--
-Fatal error: The magic method __toString() must have public visibility and can not be static in %s on line %d
+Warning: The magic method __toString() must have public visibility and can not be static in %s on line %d
+
+Fatal error: Method a::__tostring() cannot take arguments in %s on line %d
index aaeb6500d9bb410f7d67bf11abf5d0d310a9c4b7..da0757bb975212f90035fb9f2fae420a237ad6c6 100644 (file)
@@ -1206,31 +1206,31 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
                if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
                        if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __call() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __call() must have public visibility and can not be static");
                                }
                        } else if ((name_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) {
                                if ((fn_flags & (ZEND_ACC_PPP_MASK ^ ZEND_ACC_PUBLIC)) || (fn_flags & ZEND_ACC_STATIC) == 0) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __callStatic() must have public visibility and be static");
+                                       zend_error(E_WARNING, "The magic method __callStatic() must have public visibility and be static");
                                }
                        } else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __get() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __get() must have public visibility and can not be static");
                                }
                        } else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __set() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __set() must have public visibility and can not be static");
                                }
                        } else if ((name_len == sizeof(ZEND_UNSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __unset() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __unset() must have public visibility and can not be static");
                                }
                        } else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __isset() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __isset() must have public visibility and can not be static");
                                }
                        } else if ((name_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __toString() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __toString() must have public visibility and can not be static");
                                }
                        }
                } else {
@@ -1266,37 +1266,37 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
                                CG(active_class_entry)->clone = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __call() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __call() must have public visibility and can not be static");
                                }
                                CG(active_class_entry)->__call = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) {
                                if ((fn_flags & (ZEND_ACC_PPP_MASK ^ ZEND_ACC_PUBLIC)) || (fn_flags & ZEND_ACC_STATIC) == 0) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __callStatic() must have public visibility and be static");
+                                       zend_error(E_WARNING, "The magic method __callStatic() must have public visibility and be static");
                                }
                                CG(active_class_entry)->__callstatic = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __get() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __get() must have public visibility and can not be static");
                                }
                                CG(active_class_entry)->__get = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __set() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __set() must have public visibility and can not be static");
                                }
                                CG(active_class_entry)->__set = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_UNSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __unset() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __unset() must have public visibility and can not be static");
                                }
                                CG(active_class_entry)->__unset = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __isset() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __isset() must have public visibility and can not be static");
                                }
                                CG(active_class_entry)->__isset = (zend_function *) CG(active_op_array);
                        } else if ((name_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1))) {
                                if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-                                       zend_error(E_COMPILE_ERROR, "The magic method __toString() must have public visibility and can not be static");
+                                       zend_error(E_WARNING, "The magic method __toString() must have public visibility and can not be static");
                                }                               
                                CG(active_class_entry)->__tostring = (zend_function *) CG(active_op_array);
                        } else if (!(fn_flags & ZEND_ACC_STATIC)) {