-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for abstract final classes.
- Loading branch information
Guilherme Blanco
committed
Dec 1, 2014
1 parent
32949df
commit f222edd
Showing
6 changed files
with
103 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
Check if final abstract classes are supported | ||
--SKIPIF-- | ||
<?php if (version_compare(zend_version(), '2.4.0', '<=')) die('skip ZendEngine 2.4 or later needed'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
final abstract class A | ||
{ | ||
public static function display($name) | ||
{ | ||
echo "Hello $name\n"; | ||
} | ||
} | ||
|
||
A::display('Foo'); | ||
|
||
$a = new A; | ||
|
||
?> | ||
--EXPECTF-- | ||
Hello Foo | ||
|
||
Fatal error: Cannot instantiate abstract class %s in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Check if final abstract classes are final indeed | ||
--SKIPIF-- | ||
<?php if (version_compare(zend_version(), '2.4.0', '<=')) die('skip ZendEngine 2.4 or later needed'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
final abstract class A | ||
{ | ||
public static function display($name) | ||
{ | ||
echo "Hello $name\n"; | ||
} | ||
} | ||
|
||
class B extends A | ||
{ | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Class %s may not inherit from final class (%s) in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters