3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class SklepKomputerowy{ private $d; private $m; private $komp; private $mysz; private $k; public function __construct($druk, $mon, $komp, $mysz, $klaw){ $this->d = $druk; $this->m = $mon; $this->komp = $komp; $this->mysz = $mysz; $this->k = $klaw; } protected function Twojadrukarka(){ $drukarki = array( 0 => "HP", 1 => "Canon", 2 => "Creaton" ); $drukarka = $this->drukarki[$this->d]; return $this->drukarka; } public function Pokaz(){ echo Twojadrukarka(); } } $Zestaw1 = new SklepKomputerowy(0, 1, 2, 3, 4); $Zestaw->Pokaz(); ?>
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: Zestaw in /in/cYV2J on line 32 Fatal error: Uncaught Error: Call to a member function Pokaz() on null in /in/cYV2J:32 Stack trace: #0 {main} thrown in /in/cYV2J on line 32
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: Zestaw in /in/cYV2J on line 32 Fatal error: Uncaught Error: Call to a member function Pokaz() on unknown in /in/cYV2J:32 Stack trace: #0 {main} thrown in /in/cYV2J on line 32
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: Zestaw in /in/cYV2J on line 32 Fatal error: Call to a member function Pokaz() on null in /in/cYV2J on line 32
Process exited with code 255.
Output for 5.3.19 - 5.5.35
Notice: Undefined variable: Zestaw in /in/cYV2J on line 32 Fatal error: Call to a member function Pokaz() on a non-object in /in/cYV2J on line 32
Process exited with code 255.