Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
backend
php
oop
classes_objects
75overload_prop_class-set.php
75overload_prop_class-set.php
<?php class MojaKlasa { public function __set($prop,$val) { echo "Svojstvo definirano u CLASS podrucju: $prop = $val"; } //ako se ovdje stavi public $a; => nece se pozivati __set() public function metoda(){ //dinamicki definirano svojstvo (ne postoji u MojaKlasa) $this->a=33; } } $obj=new MojaKlasa; $obj->metoda(); ?>
Reload page
Preview
W3C validation
Edit Code