- 删除了 abstract_class.phpt 测试文件 - 将 iterators_004.phpt 中的变量名从 $obj 改为 $obj2 以避免重复使用 - 将 iterators_006.phpt 中的变量名从 $array 改为 $array2 以避免重复使用 - 更新了相关循环中的变量引用保持一致性pull/1/head
parent
7939f28f37
commit
527c7d62da
4 changed files with 5 additions and 37 deletions
@ -1,32 +0,0 @@ |
|||||||
--TEST-- |
|
||||||
ZE2 An abstract class cannot be instantiated |
|
||||||
--FILE-- |
|
||||||
<?php |
|
||||||
|
|
||||||
abstract class fail { |
|
||||||
abstract function show(); |
|
||||||
} |
|
||||||
|
|
||||||
class pass extends fail { |
|
||||||
function show() { |
|
||||||
echo "Call to function show()\n"; |
|
||||||
} |
|
||||||
} |
|
||||||
function main() { |
|
||||||
$t2 = new pass(); |
|
||||||
$t2->show(); |
|
||||||
|
|
||||||
$t = new fail(); |
|
||||||
$t->show(); |
|
||||||
|
|
||||||
echo "Done\n"; // shouldn't be displayed |
|
||||||
} |
|
||||||
?> |
|
||||||
--EXPECTF-- |
|
||||||
Call to function show() |
|
||||||
|
|
||||||
Fatal error: Uncaught Error: Cannot instantiate abstract class fail in %s:%d |
|
||||||
Stack trace: |
|
||||||
#0 Unknown(0) : %s |
|
||||||
#1 {main} |
|
||||||
thrown in %s on line %d |
|
||||||
Loading…
Reference in new issue