Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class X {
- public $name;
- public function __construct($name) {
- $this->name = $name;
- }
- # This must be defined in order to have array_diff() working
- #public function __toString() {
- # return $this->name;
- #}
- }
- $a = new X("A");
- $b = new X("B");
- $c = new X("C");
- $x = array($a, $b, $c);
- $y = array($b);
- $z = array_diff($x, $y); # THIS doesn't work! -> Object of class X could not be converted to string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement