forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing consistency check for abstract methods required by one …
…trait and implemented by another.
- Loading branch information
Stefan Marr
committed
Nov 1, 2011
1 parent
ceac9dc
commit 9b0d73a
Showing
3 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
The compatibility with the signature of abstract methods should be checked. | ||
--FILE-- | ||
<?php | ||
error_reporting(E_ALL); | ||
|
||
trait THelloB { | ||
public function hello() { | ||
echo 'Hello'; | ||
} | ||
} | ||
|
||
trait THelloA { | ||
public abstract function hello($a); | ||
} | ||
|
||
class TraitsTest1 { | ||
use THelloB; | ||
use THelloA; | ||
} | ||
|
||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) 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,26 @@ | ||
--TEST-- | ||
The compatibility with the signature of abstract methods should be checked. (also checking the second possible implementation branch) | ||
--FILE-- | ||
<?php | ||
error_reporting(E_ALL); | ||
|
||
trait THelloB { | ||
public function hello() { | ||
echo 'Hello'; | ||
} | ||
} | ||
|
||
trait THelloA { | ||
public abstract function hello($a); | ||
} | ||
|
||
class TraitsTest1 { | ||
use THelloA; | ||
use THelloB; | ||
} | ||
|
||
|
||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) 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