downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the Git repository for this website on git.php.net.

Source of: /manual/ro/language.types.resource.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/language.types.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'ro',
  ),
 
'this' =>
  array (
   
0 => 'language.types.resource.php',
   
1 => 'Resources',
  ),
 
'up' =>
  array (
   
0 => 'language.types.php',
   
1 => 'Types',
  ),
 
'prev' =>
  array (
   
0 => 'language.types.object.php',
   
1 => 'Objects',
  ),
 
'next' =>
  array (
   
0 => 'language.types.null.php',
   
1 => 'NULL',
  ),
 
'alternatives' =>
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="language.types.resource" class="sect1">
 <h2 class="title">Resources</h2>
 
 <p class="para">
  A <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> is a special variable, holding a reference to an
  external resource. Resources are created and used by special functions. See
  the <a href="resource.php" class="link">appendix</a> for a listing of all these
  functions and the corresponding <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> types.
 </p>

 <p class="para">
  See also the  <span class="function"><a href="function.get-resource-type.php" class="function">get_resource_type()</a></span> function.
 </p>

 <div class="sect2" id="language.types.resource.casting">
  <h3 class="title">Converting to resource</h3>
 
  <p class="para">
   As <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> variables hold special handlers to opened files,
   database connections, image canvas areas and the like, converting to a
   <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> makes no sense.
  </p>
 </div>

 <div class="sect2" id="language.types.resource.self-destruct">
  <h3 class="title">Freeing resources</h3>
 
  <p class="para">
   Thanks to the reference-counting system introduced with PHP 4&#039;s Zend Engine,
   a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> with no more references to it is detected
   automatically, and it is freed by the garbage collector. For this reason, it
   is rarely necessary to free the memory manually.
  </p>

  <blockquote class="note"><p><strong class="note">Notă</strong>:
   <span class="simpara">
    Persistent database links are an exception to this rule. They are
    <em class="emphasis">not</em> destroyed by the garbage collector. See the
    <a href="features.persistent-connections.php" class="link">persistent
    connections</a> section for more information.
   </span>
  </p></blockquote>
 
 </div>
</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites