[ create a new paste ] login | about

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

PHP, pasted on Apr 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
echo PHP_VERSION."\n";
class test{
    public $var1 = 1;
    public $var2 = 2;
    public $var3 = 3;
    public $var4 = 4;
}


$class = new test();

for($i = 1; $i <= 4; $i++){
    echo $class->{'var'.$i};
}
?>


Output:
1
2
5.2.5
1234


Create a new paste based on this one


Comments: