--- /dev/null
+--TEST--
+Bug #43323 (Wrong count abstract methods)
+--FILE--
+<?php
+abstract class bar {
+ abstract public function bar();
+}
+
+class foo extends bar {
+}
+--EXPECTF--
+Fatal error: Class foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (bar::bar) in %sbug43323.php on line 7
typedef struct _zend_abstract_info {
zend_function *afn[MAX_ABSTRACT_INFO_CNT + 1];
int cnt;
+ int ctor;
} zend_abstract_info;
static int zend_verify_abstract_class_function(zend_function *fn, zend_abstract_info *ai TSRMLS_DC) /* {{{ */
if (ai->cnt < MAX_ABSTRACT_INFO_CNT) {
ai->afn[ai->cnt] = fn;
}
- ai->cnt++;
+ if (fn->common.fn_flags & ZEND_ACC_CTOR) {
+ if (!ai->ctor) {
+ ai->cnt++;
+ ai->ctor = 1;
+ } else {
+ ai->afn[ai->cnt] = NULL;
+ }
+ } else {
+ ai->cnt++;
+ }
}
return 0;
}