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

1.1       misho       1: --TEST--
                      2: Passing Closure as parameter to an non-existent function
                      3: --FILE--
                      4: <?php
                      5: 
                      6: class foo {
                      7:        public static function __callstatic($x, $y) {
                      8:                var_dump($x,$y);
                      9:                return 1;
                     10:        }
                     11:        
                     12:        public function teste() {
                     13:                return foo::x(function &($a=1,$b) { });
                     14:        }
                     15: }
                     16: 
                     17: var_dump(call_user_func(array('foo', 'teste')));
                     18: 
                     19: ?>
                     20: --EXPECTF--
                     21: Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d
                     22: %string|unicode%(1) "x"
                     23: array(1) {
                     24:   [0]=>
                     25:   object(Closure)#%d (1) {
                     26:     ["parameter"]=>
                     27:     array(2) {
                     28:       ["$a"]=>
                     29:       string(10) "<required>"
                     30:       ["$b"]=>
                     31:       string(10) "<required>"
                     32:     }
                     33:   }
                     34: }
                     35: int(1)

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