From 08777e9615868cf2acf4dc2a86a7ef21106beddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Magalh=C3=A3es?= Date: Thu, 30 Jun 2016 09:00:33 +0200 Subject: [PATCH] Don't enforce LSP if prototype method is private Fixes bug #72496. --- NEWS | 2 ++ Zend/tests/bug72496.phpt | 43 ++++++++++++++++++++++++++++++++++++++++ Zend/zend_compile.c | 4 ++-- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 Zend/tests/bug72496.phpt diff --git a/NEWS b/NEWS index a884dbbbeb7..eda6726a8ce 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Fix bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA). (mike dot laspina at gmail dot com, Remi) + . Fix bug #72496 (Cannot declare public method with signature incompatible + with parent private method). (Pedro Magalhães) - bz2: . Fix bug #72447 (Type Confusion in php_bz2_filter_create()). (gogil at diff --git a/Zend/tests/bug72496.phpt b/Zend/tests/bug72496.phpt new file mode 100644 index 00000000000..62e55cb5614 --- /dev/null +++ b/Zend/tests/bug72496.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #72496 (declare public method with signature incompatible with parent private method should not throw a warning) +--FILE-- +common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) { + /* If the prototype method is private do not enforce a signature */ + if (proto->common.fn_flags & ZEND_ACC_PRIVATE) { return 1; }