<?php
class Main
{
public static $myVar ;
function __construct( )
{
self::$myVar = "krakjoe" ;
printf( "%s: my name is %s\r\n", __CLASS__, self::$myVar );
}
}
class Next extends Main
{
function __construct( )
{
printf( "%s: my name is still %s\r\n", __CLASS__, parent::$myVar );
}
}
class Another extends Main
{
function __construct( )
{
printf( "%s: my name is still %s\r\n", __CLASS__, parent::$myVar );
}
}
$oMain = new Main( );
$oNext = new Next( );
$oAnother = new Another( );
printf( "Procedurally my name is still %s\r\n", Main::$myVar );
?>