[ create a new paste ] login | about

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

PHP, pasted on May 16:
<?php
class A{
    var $s;
    function set($x){
        $this->s = $x;
    }
    function get(){
        return $this->s;
    }
}
class B{
    var $s;
    function set($x){
        $this->s = $x;
    }
    function get(){
        return $this->s;
    }
}
$all = array(new A, new B);
$A1 = $all[0];
$A1->set(120);
$B1 = $all[0];
echo $B1->get(); // 120


Output:
1
120


Create a new paste based on this one


Comments: