Annotation of embedaddon/php/Zend/tests/call_user_func_001.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Testing call_user_func inside namespace
                      3: --FILE--
                      4: <?php
                      5: 
                      6: namespace testing {
                      7:        function foobar($str) {
                      8:                var_dump($str);
                      9:        }
                     10:        
                     11:        abstract class bar {
                     12:                protected function prot($str) {
                     13:                        print "Shouldn't be called!\n";
                     14:                }
                     15:        }
                     16:        class foo extends bar {
                     17:                private function priv($str) {
                     18:                        print "Shouldn't be called!\n";
                     19:                }
                     20:        }
                     21:        
                     22:        call_user_func(__NAMESPACE__ .'\foobar', 'foobar');
                     23:        
                     24:        $class =  __NAMESPACE__ .'\foo';
                     25:        call_user_func(array(new $class, 'priv'), 'foobar');
                     26:        call_user_func(array(new $class, 'prot'), 'foobar');
                     27: }
                     28: 
                     29: ?>
                     30: --EXPECTF--
                     31: %string|unicode%(6) "foobar"
                     32: 
                     33: Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() in %s on line %d
                     34: 
                     35: Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() in %s on line %d

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