- Fixed memory leak in the realpath cache on Windows. (Pierre)
- Fixed memory leak in zip_close. (Pierre)
-- Fixed #51059 (crypt crashes when invalid salt are given). (Pierre)
+- Fixed bug #51176 (Static calling in non-static method behaves like $this->).
+ (Felipe)
+- Fixed bug #51059 (crypt crashes when invalid salt are given). (Pierre)
- Fixed bug #50952 (allow underscore _ in constants parsed in php.ini files).
(Jani)
- Fixed bug #50940 (Custom content-length set incorrectly in Apache SAPIs).
--- /dev/null
+--TEST--
+Bug #51176 (Static calling in non-static method behaves like $this->)
+--FILE--
+<?php
+class Foo
+{
+ public function start()
+ {
+ self::bar();
+ static::bar();
+ Foo::bar();
+ }
+
+ public function __call($n, $a)
+ {
+ echo "instance\n";
+ }
+
+ public static function __callStatic($n, $a)
+ {
+ echo "static\n";
+ }
+}
+
+$foo = new Foo();
+$foo->start();
+
+?>
+--EXPECT--
+static
+static
+static
if (!fbc && zend_hash_find(&ce->function_table, lc_function_name, function_name_strlen+1, (void **) &fbc)==FAILURE) {
efree(lc_function_name);
- if (ce->__call &&
+ if (ce->__callstatic) {
+ return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
+ } else if (ce->__call &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
return zend_get_user_call_function(ce, function_name_strval, function_name_strlen);
- } else if (ce->__callstatic) {
- return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
} else {
return NULL;
}