IT. Expert System.

PHP

Releases a previously acquired reference


Weakref::release

(PECL weakref >= 0.1.0)

Weakref::releaseReleases a previously acquired reference

Description

public bool Weakref::release ( void )

Releases a previously acquired reference. Potentially turning a strong reference back into a weak reference.

Parameters

This function has no parameters.

Return Values

Returns TRUE if the reference was previously acquired and thus could be released, FALSE otherwise.

Examples

Example #1 Weakref::release() example

<?php
class MyClass {
    public function 
__destruct() {
        echo 
"Destroying object!\n";
    }
}

$o1 = new MyClass;

$r1 = new Weakref($o1);

$r1->acquire();

echo 
"Unsetting o1...\n";
unset(
$o1);

$o2 $r1->get();

$r1->release();

echo 
"Unsetting o2...\n";
unset(
$o2);
?>

The above example will output:

 Unsetting o1... Unsetting o2... Destroying object! 

See Also



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 464 / 158798985. Delta: 0.02253 с