@ 2017-10-07T10:15:33Z <?php
namespace WFPKSYS;
{
trait SupportSystemConfiguration
{
protected $_supportSystemConfiguration;
public function getSupportSystemConfiguration() : \WFPKSYS\SupportSystemConfiguration
{ return $this->_supportSystemConfiguration; }
public function setSupportSystemConfiguration( \WFPKSYS\SupportSystemConfiguration $supportSystemConfiguration ) : void
{ $this->_supportSystemConfiguration = $supportSystemConfiguration; }
}
}
namespace WFPKSYS;
{
class SupportSystemConfiguration
{
private $_db_Name;
public function __construct()
{$this->setDb_Name( "MyTestDb" );}
public function getDb_Name() : string
{ return $this->_db_Name; }
public function setDb_Name( string $db_Name ) : void
{ $this->_db_Name = $db_Name; }
}
}
namespace WFPKSYS\Set2;
{
class Foo
{
use \WFPKSYS\SupportSystemConfiguration;
public function __construct(\WFPKSYS\SupportSystemConfiguration $supportSystemConfig)
{ $this->setSupportSystemConfiguration( $supportSystemConfig ); }
public function displayCheck() : void
{
#do something that doesnt return anything
}
}
}
namespace WFPKSYS\Set2;
{
class Bar
{
use \WFPKSYS\SupportSystemConfiguration;
public function __construct(\WFPKSYS\SupportSystemConfiguration $supportSystemConfig)
{$this->setSupportSystemConfiguration( $supportSystemConfig );}
public function displayCheck() : void
{
#do something that doesnt return anything
}
}
}
namespace WFPKSYS\Set3;
{
class Fuzz
{
use \WFPKSYS\SupportSystemConfiguration;
public function __construct(\WFPKSYS\SupportSystemConfiguration $supportSystemConfig )
{ $this->setSupportSystemConfiguration( $supportSystemConfig ); }
public function performCheck() : string
{
$objFoo = new \WFPKSYS\Set1\Foo( $this->getSupportSystemConfiguration() );
$objBar = new \WFPKSYS\Set2\Bar( $this->getSupportSystemConfiguration() );
$objFoo->displayCheck();
$objBar->displayCheck();
return "completed";
}
}
}
$objSupportSystemConfiguration = new \WFPKSYS\SupportSystemConfiguration();
$objFuzz = new \WFPKSYS\Set3\Fuzz( $objSupportSystemConfiguration );
echo $objFuzz->performCheck();
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.24 , 7.1.0 - 7.1.20 , 7.2.6 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 Fatal error: Cannot declare class WFPKSYS\SupportSystemConfiguration, because the name is already in use in /in/4Q511 on line 20
Process exited with code 255 . Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Fatal error: Cannot declare class WFPKSYS\SupportSystemConfiguration, because the name is already in use in /in/4Q511 on line 20
Process exited with code 255 . preferences:dark mode live preview
199.71 ms | 402 KiB | 178 Q