|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 Aug 2015, PHP 7.0.0 RC 1
+- Code:
+ . Fixed bug #70215 (Segfault when __invoke is static). (Bob)
+
+- Phpdbg:
+ . Fixed bug #70214 (FASYNC not defined, needs sys/file.h include). (Bob)
+
- Standard:
. Fixed bug #70208 (Assert breaking access on objects). (Bob)
--- /dev/null
+--TEST--
+Bug #70215 (Segfault when invoke is static)
+--FILE--
+<?php
+
+class A {
+ public static function __invoke() {
+ echo __CLASS__;
+ }
+}
+
+class B extends A { }
+
+$b = new B;
+
+$b();
+
+?>
+--EXPECTF--
+Warning: The magic method __invoke() must have public visibility and cannot be static in %s on line %d
+A
ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
GC_REFCOUNT(fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
- } else {
+ } else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
GC_REFCOUNT(fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
- } else {
+ } else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
GC_REFCOUNT(fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
- } else {
+ } else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
ZEND_ASSERT(GC_TYPE(fbc->common.prototype) == IS_OBJECT);
GC_REFCOUNT(fbc->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
- } else {
+ } else if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}