[ create a new paste ] login | about

Link: http://codepad.org/3QnRCFsf    [ raw code | output | fork ]

PHP, pasted on Dec 3:
<?php

class test{
public $test1 = "this is a test of a pulic property";
private $test2 = "this is a test of a private property";
protected $test3 = "this is a test of a protected property";
const hello = 900000;
function __construct($h){
    //echo 'this is the constructor test '.$h;
}

function x($x2){
    echo ' this is fn x'.$x2;
}
function y(){
    print "this is fn y";
}

function __destruct(){
    echo 'now dieing...bye bye :-(';
}
}



class hey extends test{
    function hey(){
        $this->x('<br>from the host with the most');
        echo ' <br>from hey class'.$this->test3;
    }


}
$obj = new test("this is an \"arg\" sent to instance of test");
$obj2 = new hey();
echo $obj2->hello;

?>


Output:
1
 this is fn x<br>from the host with the most <br>from hey classthis is a test of a protected propertynow dieing...bye bye :-(now dieing...bye bye :-(


Create a new paste based on this one


Comments: