declare variable in php class
snippet in php

php define class

user4963

class Bike {
    	function Bike() {
            $this->type = 'BMX';
    }
}

$blackSheep = new Bike();

print $blackSheep->type;

declare variable in php class

user9731


<?php
class SimpleClass
{
   public $var1 = 'hello';
}
?>