Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbserverprogrammering/exercises/classes/

ovn_cls1.php
ovn_cls2.php
ovn_cls3.php
ovn_cls4.php
ovn_cls5.php
ovn_cls6.php
ovn_cls7.php

ovn_cls1.php

26 lines ASCII Windows (CRLF)
<?php

class Ball
{
    
// Properties
    
public $color;
    public 
$radius;

    
// Methods
    
function set_ball($color$radius)
    {
        
$this->color $color;
        
$this->radius $radius;
    }

    function 
get_ball()
    {
        return [
$this->color$this->radius];
    }
}


$my_ball = new Ball();
$my_ball->set_ball("red""12");
print_r($my_ball->get_ball());