[ create a new paste ] login | about

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

PHP, pasted on Jun 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
class foo{

    protected $fooVariable;

    function __construct(){
      $this->fooVariable = "hello world";
      $this->changeVariable();
    }
    function changeVariable(){
      $this->fooVariable = "goodbye world";
      $this->echoVariable();
    }
    function echoVariable(){
      echo $this->fooVariable;
    }
}
$a = new foo;


Output:
1
goodbye world


Create a new paste based on this one


Comments: