<?php class Foo { public static $classStatic = 1; public function test() { static $methodStatic = 1; return $methodStatic++; } } class Bar extends Foo {} $foo1 = new Foo; $foo2 = new Foo; $bar = new Bar; var_dump( $foo1->test(), $foo2->test(), $bar->test() ); Foo::$classStatic++; var_dump( Foo::$classStatic, Bar::$classStatic );
You have javascript disabled. You will not be able to edit any code.