3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class MyFile { private $filename; private $mimeType; public function __construct($filename, $mimeType) { $this->filename = $filename; $this->mimeType = $mimeType; } public function getFilename() { return $this->filename; } public function getMimeType() { return $this->mimeType; } public function __toString() { return $this->filename; } } $array1[] = new MyFile("peter.jpg", "image/jpg"); $array1[] = new MyFile("peter.jpg", "image/png"); $array1[] = new MyFile("michal.jpg", "image/jpg"); $array2[] = new MyFile("johan.jpg", "image/jpg"); $array2[] = new MyFile("peter.jpg", "image/jpg"); $diffArray = array_diff($array1, $array2); var_dump($diffArray);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [2]=> object(MyFile)#3 (2) { ["filename":"MyFile":private]=> string(10) "michal.jpg" ["mimeType":"MyFile":private]=> string(9) "image/jpg" } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.71 ms | 401 KiB | 8 Q