<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.php.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'book.operator.php',
    1 => 'Operator Overloading',
    2 => 'Operator Overloading for Objects',
  ),
  'up' => 
  array (
    0 => 'refs.basic.php.php',
    1 => '影响 PHP 行为的扩展',
  ),
  'prev' => 
  array (
    0 => 'function.opcache-reset.php',
    1 => 'opcache_reset',
  ),
  'next' => 
  array (
    0 => 'operator.setup.php',
    1 => '安装/配置',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/operator/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.operator.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.operator" class="book">
 
 <h1 class="title">Operator Overloading for Objects</h1>
 

 
 <div id="intro.operator" class="preface">
  <h1 class="title">简介</h1>
  <p class="simpara">
   This extension defines and implements operator overloading for objects.
   It allows defining how an object reacts when an operator is used on it.
  </p>
  <p class="simpara">
   One example of this is creating a collection type object that has the addition
   operator overloaded to allow adding elements to the collection or adding two
   collections together.
  </p>
  <p class="simpara">
   Another example is creating an enhanced string class that has the multiplication
   operator overloaded to allow repeating the string a certain number of times.
  </p>
 </div>
 
 




 




<ul class="chunklist chunklist_book"><li><a href="operator.setup.php">安装/配置</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="operator.installation.php">安装</a></li></ul></li><li><a href="operator.overloading.php">Operator Overloading Magic Methods</a></li></ul></div><?php manual_footer($setup); ?>