mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
1
NEWS
1
NEWS
@@ -23,6 +23,7 @@ PHP NEWS
|
||||
. Fixed bug #36365 (scandir duplicates file name at every 65535th file).
|
||||
(cmb)
|
||||
. Use SSE2 instructions do locale independent strtolower. (Laruence)
|
||||
. Fixed bug #79521 (Check __set_state structure). (carusogabriel)
|
||||
|
||||
- BZ2:
|
||||
. Fixed bug #71263 (fread() does not report bzip2.decompress errors). (cmb)
|
||||
|
||||
14
Zend/tests/magic_methods_set_state.phpt
Normal file
14
Zend/tests/magic_methods_set_state.phpt
Normal file
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Testing __set_state() declaration with wrong modifier
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
function __set_state()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: The magic method Foo::__set_state() must be static in %s on line %d
|
||||
@@ -6170,6 +6170,8 @@ zend_string *zend_begin_method_decl(zend_op_array *op_array, zend_string *name,
|
||||
zend_check_magic_method_attr(fn_flags, ce, "__serialize", 0);
|
||||
} else if (zend_string_equals_literal(lcname, "__unserialize")) {
|
||||
zend_check_magic_method_attr(fn_flags, ce, "__unserialize", 0);
|
||||
} else if (zend_string_equals_literal(lcname, "__set_state")) {
|
||||
zend_check_magic_method_attr(fn_flags, ce, "__set_state", 1);
|
||||
}
|
||||
|
||||
return lcname;
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestClass
|
||||
|
||||
public function __wakeup() {}
|
||||
|
||||
public function __set_state() {}
|
||||
public static function __set_state() {}
|
||||
|
||||
public function __autoload() {}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ Modifiers for method TestClass::__wakeup():
|
||||
|
||||
|
||||
Modifiers for method TestClass::__set_state():
|
||||
0x00000001
|
||||
0x00000011
|
||||
|
||||
|
||||
Modifiers for method TestClass::__autoload():
|
||||
@@ -207,7 +207,7 @@ Modifiers for method TestClass::__wakeup():
|
||||
|
||||
|
||||
Modifiers for method TestClass::__set_state():
|
||||
0x00000001
|
||||
0x00000011
|
||||
|
||||
|
||||
Modifiers for method TestClass::__autoload():
|
||||
|
||||
Reference in New Issue
Block a user