Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php-oop

<?php


class My{

    public $name,$age;

    public function __construct($myName,$myAge)
    {
        $this->name = $myName;
        $this->age = $myAge;

    }
}

$me = new My("WinWinMaw",22);
//$me->name = "hhz";
//$me->age = 22;

$my = new My("Maw",20);
//$me->name = "hhz";
//$me->age = 22;

$abc = new My("abc",32);


print_r([$me,$my,$abc]);
?>


//run => php filename.php
Source by www.greycampus.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+7 =