<<< Torna alla lista degli esempi

La classe "\fire\Object"

La classe "\fire\Object" รจ la radice di tutte le gerarchie di classi presenti nella libreria. Consente di ottenere alcune informazioni riguardanti qualsiasi oggetto e di sincronizzare gli oggetti condivisi fra flussi concorrenti.
Source code:
		

	include("fxcore.php");

	$object0 = new \fire\Object();
	echo "object0 string: " . $object0->toString() . "\n";
	echo "object0 hash code: " . $object0->hashCode() . "\n";
	$object1 = new \fire\Object();
	echo "object1 hash code: " . $object1->hashCode() . "\n";
	if ($object0->equals($object0)) {
	echo "object0 == object0\n";
	}
	if (!$object0->equals($object1)) {
	echo "object0 != object1\n";
	}
	class Object extends \fire\Object {
	  function toString() {
	    return "Object";
	  }
	}
	$object2 = new Object();
	echo "object2 string: " . $object2->toString() . "\n";
	echo "object2 hash code: " . $object2->hashCode() . "\n";
	$object2Class = new \fire\Clazz($object2);
	echo "object2 class name: " . $object2Class->getName() . "\n";



	
Output:
<<< Torna alla lista degli esempi