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
85iteration_prop_class.php
85iteration_prop_class.php
<?php class MojaKlasa { public $pub='Public svojstvo '; protected $prot='Protected svojstvo '; private $priv='Private svojstvo '; public static $stat='Static svojstvo'; public function ispis(){ foreach($this as $prop=>$val){ echo $prop." = ".$val; echo "<br/>"; } } } //defininranje objekta $obj=new MojaKlasa; $obj->ispis(); /*Zakljucak: foreach iterira public, private i protected u CLASS podrucju*/ ?>
Reload page
Preview
W3C validation
Edit Code