3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace WFPKSYS\System\Traits\Configuration; { trait SupportSystemConfiguration { protected $_supportSystemConfiguration; public function getSupportSystemConfiguration() : \WFPKSYS\SupportSystem\Models\Configuration\SupportSystemConfiguration { return $this->_supportSystemConfiguration; } public function setSupportSystemConfiguration( \WFPKSYS\SupportSystem\Models\Configuration\SupportSystemConfiguration $supportSystemConfiguration ) : void { $this->_supportSystemConfiguration = $supportSystemConfiguration; } } } namespace WFPKSYS\SupportSystem\Models\Configuration; { 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\SupportSystem\Models; { class Foo { use \WFPKSYS\System\Traits\Configuration\SupportSystemConfiguration; public function __construct(\WFPKSYS\SupportSystem\Models\Configuration\SupportSystemConfiguration $supportSystemConfig) { $this->setSupportSystemConfiguration( $supportSystemConfig ); } public function displayCheck() : void { #do something that doesnt return anything } } } namespace WFPKSYS\SupportSystem\Models; { class Bar { use \WFPKSYS\System\Traits\Configuration\SupportSystemConfiguration; public function __construct(\WFPKSYS\SupportSystem\Models\Configuration\SupportSystemConfiguration $supportSystemConfig) {$this->setSupportSystemConfiguration( $supportSystemConfig );} public function displayCheck() : void { #do something that doesnt return anything } } } namespace WFPKSYS\SupportSystem\Models; { class Fuzz { use \WFPKSYS\System\Traits\Configuration\SupportSystemConfiguration; public function __construct(\WFPKSYS\SupportSystem\Models\Configuration\SupportSystemConfiguration $supportSystemConfig ) { $this->setSupportSystemConfiguration( $supportSystemConfig ); } public function performCheck() : string { $objFoo = new \WFPKSYS\SupportSystem\Models\Foo( $this->getSupportSystemConfiguration() ); $objBar = new \WFPKSYS\SupportSystem\Models\Bar( $this->getSupportSystemConfiguration() ); $objFoo->displayCheck(); $objBar->displayCheck(); return "completed"; } } } $objSupportSystemConfiguration = new \WFPKSYS\SupportSystem\Models\Configuration\SupportSystemConfiguration(); $objFuzz = new \WFPKSYS\SupportSystem\Models\Fuzz( $objSupportSystemConfiguration ); echo $objFuzz->performCheck();
Output for git.master, git.master_jit, rfc.property-hooks
completed

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:
44.48 ms | 401 KiB | 8 Q