[ create a new paste ] login | about

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

php.programmer - PHP, pasted on May 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
// zcephp5 oops
class myclass
{
 function reassign($ref)
 {
   $this = $ref;
 }
}

$a = new myclass();
$b = new myclass();
$a->reassign($b);
?>


Output:
1
2

Fatal error: Cannot re-assign $this on line 7


Create a new paste based on this one


Comments: