<?php
class Derp {
public $d;
public function __construct() {
$this->d = $d;
}
public function __toString() {
return '1';
}
}
$d = array(new Derp(1), new Derp(2), new Derp(3));
var_dump(array_unique($d));
Warning: Undefined variable $d in /in/jhH3d on line 8
Warning: Undefined variable $d in /in/jhH3d on line 8
Warning: Undefined variable $d in /in/jhH3d on line 8
array(1) {
[0]=>
object(Derp)#1 (1) {
["d"]=>
NULL
}
}
Notice: Undefined variable: d in /in/jhH3d on line 8
Notice: Undefined variable: d in /in/jhH3d on line 8
Notice: Undefined variable: d in /in/jhH3d on line 8
array(1) {
[0]=>
object(Derp)#1 (1) {
["d"]=>
NULL
}
}
Notice: Undefined variable: d in /in/jhH3d on line 8
Notice: Undefined variable: d in /in/jhH3d on line 8
Notice: Undefined variable: d in /in/jhH3d on line 8
array(3) {
[0]=>
object(Derp)#1 (1) {
["d"]=>
NULL
}
[1]=>
object(Derp)#2 (1) {
["d"]=>
NULL
}
[2]=>
object(Derp)#3 (1) {
["d"]=>
NULL
}
}
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: d in /in/jhH3d on line 8
Notice: Undefined variable: d in /in/jhH3d on line 8
Notice: Undefined variable: d in /in/jhH3d on line 8
array(3) {
[0]=>
object(Derp)#1 (1) {
["d"]=>
NULL
}
[1]=>
object(Derp)#2 (1) {
["d"]=>
NULL
}
[2]=>
object(Derp)#3 (1) {
["d"]=>
NULL
}
}
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/jhH3d on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/jhH3d on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/jhH3d on line 5
Process exited with code 255.