Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

weakref(3) [php man page]

WEAKREF(3)								 1								WEAKREF(3)

The WeakRef class

INTRODUCTION
The WeakRef class provides a gateway to objects without preventing the garbage collector from freeing those objects. It also provides a way to turn a weak reference into a strong one. CLASS SYNOPSIS
WeakRef WeakRef Methods o public Weakref::__construct (object $object) o public bool Weakref::acquire (void ) o public object Weakref::get (void ) o public bool Weakref::release (void ) o public bool Weakref::valid (void ) EXAMPLES
Example #1 WeakRef usage example <?php class MyClass { public function __destruct() { echo "Destroying object! "; } } $o1 = new MyClass; $r1 = new WeakRef($o1); if ($r1->valid()) { echo "Object still exists! "; var_dump($r1->get()); } else { echo "Object is dead! "; } unset($o1); if ($r1->valid()) { echo "Object still exists! "; var_dump($r1->get()); } else { echo "Object is dead! "; } ?> The above example will output: Object still exists! object(MyClass)#1 (0) { } Destroying object! Object is dead! PHP Documentation Group WEAKREF(3)

Check Out this Related Man Page

GEARMANWORKER(3)							 1							  GEARMANWORKER(3)

The GearmanWorker class

INTRODUCTION
CLASS SYNOPSIS
GearmanWorker GearmanWorker Methods o public bool GearmanWorker::addFunction (string $function_name, callable $function, [mixed &$context], [int $timeout]) o public bool GearmanWorker::addOptions (int $option) o public bool GearmanWorker::addServer ([string $host = 127.0.0.1], [int $port = 4730]) o public bool GearmanWorker::addServers (string $servers = 127.0.0.1:4730) o public void GearmanWorker::clone (void ) o public GearmanWorker::__construct (void ) o public bool GearmanWorker::echo (string $workload) o public string GearmanWorker::error (void ) o public int GearmanWorker::getErrno (void ) o public int GearmanWorker::options (void ) o public bool GearmanWorker::register (string $function_name, [int $timeout]) o public bool GearmanWorker::removeOptions (int $option) o public int GearmanWorker::returnCode (void ) o public bool GearmanWorker::setId (string $id) o public bool GearmanWorker::setOptions (int $option) o public bool GearmanWorker::setTimeout (int $timeout) o public int GearmanWorker::timeout (void ) o public bool GearmanWorker::unregister (string $function_name) o public bool GearmanWorker::unregisterAll (void ) o public bool GearmanWorker::wait (void ) o public bool GearmanWorker::work (void ) PHP Documentation Group GEARMANWORKER(3)
Man Page