3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for git.master, git.master_jit, rfc.property-hooks
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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.35 ms | 401 KiB | 8 Q