Skip to content

Instantly share code, notes, and snippets.

@tobyink
Created December 13, 2013 14:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobyink/7945258 to your computer and use it in GitHub Desktop.
Save tobyink/7945258 to your computer and use it in GitHub Desktop.
<?php
class A {
public $errors;
}
class B extends A {
public $errors;
public $value = null;
public function __construct($value) {
$this->value = $value;
}
}
$object1 = new B('ABC');
$object2 = new B('CBA');
var_dump($object1 == $object2);
print_r($object1, true);
print_r($object2, true);
var_dump($object1 == $object2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment