File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug63111.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:17 2013 UTC (11 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

    1: --TEST--
    2: Bug #63111 (is_callable() lies for abstract static method)
    3: --FILE--
    4: <?php
    5: abstract class Foo {
    6:         abstract static function bar();
    7: }
    8: interface MyInterface {
    9:     static function bar();
   10: }
   11: abstract class Bar {
   12: 	static function foo() {
   13: 		echo "ok\n";
   14: 	}
   15: }
   16: var_dump(is_callable(array("Foo", "bar")));
   17: var_dump(is_callable("Foo::bar"));
   18: var_dump(is_callable(array("MyInterface", "bar")));
   19: var_dump(is_callable("MyInterface::bar"));
   20: var_dump(is_callable(array("Bar", "foo")));
   21: var_dump(is_callable("Bar::foo"));
   22: Bar::foo();
   23: Foo::bar();
   24: ?>
   25: --EXPECTF--
   26: Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3
   27: bool(false)
   28: bool(false)
   29: bool(false)
   30: bool(false)
   31: bool(true)
   32: bool(true)
   33: ok
   34: 
   35: Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20
   36: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>