Nie pojmuję fenomenu Win10.
Mam 7 ale tylko po to żeby sobie czasami Diablo odpalić albo jakieś inne i po nic więcej.
<?php class A { public function something() { $this->dqwidjoqiwdqj = 123; } } $a = new A(); $a->something(); // 123
<?php class A { public function something() { $this->dqwidjoqiwdqj = 123; } } $a = new A(); $a->something(); // 123 // true // false
<?php $cos = 'cos';
class Test { public function test() { return $this->property; } } $t = new Test();
class A { protected $b; public function testC() { $this->b = 'ok'; $this->c = 'some exception thrown'; } } $a = new A(); $a->testC(); // Exception
$cos; // jakis var $cos żeby było wiadomo, że to deklaracja? $cos = 'ok'; $cosInnego = 'nie ok';
class Test { protected $a; public function __set($name, $value) { if (!property_exists(get_class($this), $name)) { throw new Exception("ERR"); } $this->$name = $value; } public function xyz() { $this->b = 'exception'; } } $t = new Test(); $t->a = 'ok'; $t->b = 'exception'; $t->xyz(); // exception
class Person { private $name; public function __construct($name) { $this->nme = $name; } public function getName() { return $this->name; } }
class Person { private $name; public function __construct($name) { $this->nme = $name; } public function getName() { return $this->name; } }
Skoro tam powinien rzucać błąd, to tu też?
$name = 'xxx'; if (costam()) { $nme = 'yyy'; }
$name = 'xxx'; if (costam()) { $nme = 'yyy'; }
... public function __set($name, $value) { throw new Exception("ERR"); } ...