Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/10/2011, 13:42
bigwhite
 
Fecha de Ingreso: agosto-2009
Mensajes: 247
Antigüedad: 14 años, 8 meses
Puntos: 10
Bugs de PHP 5.3 para static ?

Código PHP:
class Foo
{
    public static 
$my_static 2;

    public static function 
getVar() {
        return 
self::$my_static;
    }
    
    public static function 
bar(){
      
Foo::$my_static +=55;
    }    
# end class

Foo::bar();
echo 
Foo::getVar(); 
Salida: 57 ... OK

Código PHP:
class Foo
{
    public static 
$my_static 'foo';

    public static function 
getVar() {
        return 
self::$my_static;
    }
    
    public static function 
bar(){
      
Foo::$my_static +=' bar';
    }    
# end class

Foo::bar();
echo 
Foo::getVar(); 
Salida: 0

Como se explica eso ?
__________________
The best powerful search engine for MSN messenger profiles I know is msn profile viewer. It's really good either if you have an e-mail address or not. Try it!