summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-12-17 15:51:52 +0000
committerMarcus Boerger <helly@php.net>2005-12-17 15:51:52 +0000
commit18a99796ada958860506c485728b40aeebc46f52 (patch)
tree1ca44c9ff1d8647b3b08189c98145b3ec0d9d16c /tests
parentadc26d2bcacbdcce78e6979a9d18fb5aafc5dc34 (diff)
downloadphp-git-18a99796ada958860506c485728b40aeebc46f52.tar.gz
- MFH Fix Bug #35720 A final constructor can be overwritten
Diffstat (limited to 'tests')
-rwxr-xr-xtests/classes/final_ctor1.phpt29
-rwxr-xr-xtests/classes/final_ctor2.phpt29
2 files changed, 58 insertions, 0 deletions
diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt
new file mode 100755
index 0000000000..ebfa08081e
--- /dev/null
+++ b/tests/classes/final_ctor1.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 cannot override final __construct
+--FILE--
+<?php
+
+class Base
+{
+ public final function __construct()
+ {
+ }
+}
+
+class Works extends Base
+{
+}
+
+class Extended extends Base
+{
+ public function Extended()
+ {
+ }
+}
+
+ReflectionClass::export('Extended');
+
+?>
+--EXPECTF--
+
+Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d
diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt
new file mode 100755
index 0000000000..905337b408
--- /dev/null
+++ b/tests/classes/final_ctor2.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 cannot override final old style ctor
+--FILE--
+<?php
+
+class Base
+{
+ public final function Base()
+ {
+ }
+}
+
+class Works extends Base
+{
+}
+
+class Extended extends Base
+{
+ public function __construct()
+ {
+ }
+}
+
+ReflectionClass::export('Extended');
+
+?>
+--EXPECTF--
+
+Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d