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
Post a Comment