File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug26802.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #26802 (Can't call static method using a variable)
    3: --FILE--
    4: <?php
    5: 
    6: function global_func()
    7: {
    8: 	echo __METHOD__ . "\n";
    9: }
   10: 
   11: $function = 'global_func';
   12: $function();
   13: 
   14: class foo
   15: {
   16: 	static $method = 'global_func';
   17: 	
   18: 	static public function foo_func()
   19: 	{
   20: 		echo __METHOD__ . "\n";
   21: 	}
   22: }
   23: 
   24: /* The following is a BC break with PHP 4 where it would 
   25:  * call foo::fail. In PHP 5 we first evaluate static class 
   26:  * properties and then do the function call.
   27:  */
   28: $method = 'foo_func';
   29: foo::$method();
   30: 
   31: 
   32: ?>
   33: ===DONE===
   34: --EXPECT--
   35: global_func
   36: foo::foo_func
   37: ===DONE===

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