<?php class Foo { public static $x; public static function SetValue() { Foo::$x = 10; } public static function ShowValue() { echo Foo::$x."\n"; } } Foo::SetValue(); Foo::ShowValue(); // O mejor aun class Bar { public static $x; public static function SetValue() { self::$x = 10; } public static function ShowValue() { echo self::$x."\n"; } } Bar::SetValue(); Bar::ShowValue();
You have javascript disabled. You will not be able to edit any code.