3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pumpkin { public $a; protected $b; private $c; public function __construct ($a, $b, $c) { $this->a = $a; $this->b = $b; $this->c = $c; } } $x = new Pumpkin(1, 2, 3); $zpublic = new Pumpkin(99, 2, 3); // public property differs $zprotected = new Pumpkin(1, 99, 3); // protected property differs $zprivate = new Pumpkin(1, 2, 99); //private property differs $ztypediffers = new Pumpkin("1", 2, 3); // same values but different types... var_dump($x == $zpublic); // ? var_dump($x == $zprotected); var_dump($x == $zprivate); var_dump($x == $ztypediffers);

preferences:
34.98 ms | 402 KiB | 5 Q