oop - usage of multiple properties in php -


i trying learn oop in php, below code not working provide alternate answer?

<?php     class abc {         public $a = 1;         $b = $a;          function foo(){             //some function..         }      } ?> 

i want assign value of variable "a" variable "b".

you can assign value of $a $b so: $this->b = $this->a within __construct method gets called upon object creation, assuming you're running php 5.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -