3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bool2str($bool) { if ($bool === false) { return 'FALSE'; } else { return 'TRUE'; } } function compareObjects(&$o1, &$o2) { echo 'o1 != o2 : ' . bool2str($o1 instanceof $o2) . "\n"; } class Flag { public $flag; function Flag($flag = true) { $this->flag = $flag; } } class OtherFlag { public $flag; function OtherFlag($flag = true) { $this->flag = $flag; } } $o = new Flag(); $p = new Flag(); $q = $o; $r = new OtherFlag(); compareObjects($o, $p); echo "\nЭкземпляры двух разных классов\n"; compareObjects($o, $r);
Output for git.master, git.master_jit, rfc.property-hooks
o1 != o2 : TRUE Экземпляры двух разных классов o1 != o2 : FALSE

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:
52.15 ms | 401 KiB | 8 Q