Annotation of embedaddon/php/ext/standard/tests/class_object/get_declared_interfaces_variation1.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test get_declared_interfaces() function : autoloading of interfaces
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : proto array get_declared_interfaces()
                      6:  * Description: Returns an array of all declared interfaces. 
                      7:  * Source code: Zend/zend_builtin_functions.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: 
                     12: echo "*** Testing get_declared_interfaces() : autoloading of interfaces ***\n";
                     13: 
                     14: function __autoload($class_name) {
                     15:     require_once $class_name . '.inc';
                     16: }
                     17: 
                     18: echo "\n-- before interface is used --\n";
                     19: var_dump(in_array('AutoInterface', get_declared_interfaces()));
                     20: 
                     21: 
                     22: echo "\n-- after interface is used --\n";
                     23: class Implementor implements AutoInterface {}
                     24: var_dump(in_array('AutoInterface', get_declared_interfaces()));
                     25: 
                     26: echo "\nDONE\n";
                     27: ?>
                     28: --EXPECTF--
                     29: *** Testing get_declared_interfaces() : autoloading of interfaces ***
                     30: 
                     31: -- before interface is used --
                     32: bool(false)
                     33: 
                     34: -- after interface is used --
                     35: bool(true)
                     36: 
                     37: DONE

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