<commit_before><?xml version="1.0" encoding="iso-8859-1"?>
<document title="XP::About::Future">
  <main>
    <references>
      <ref link="about">Introduction</ref>
      <ref type="ext" link="http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES?r=head">Changes in the Zend Engine 2.0</ref>
      <ref type="ext" link="http://www.phpmag.de/itr/online_artikel/show.php3?id=207&amp;nodeid=62">Generationenwechsel [Zend Engine 2: Leistungsmerkmale, Geschichte und Designmaximen]</ref>
    </references>
    <content>
      <title>The future of XP</title>
      <editor>$Id$</editor>
      
      <para>
        <caption>The Zend Engine 2</caption>
        <text>
          In the Zend Engine 2 [ZE2], the object model has been largely rewritten. A short overview
          of the new functionality:
          
          <ul>
            <li>Objects are passed by handle, not by value.</li>
            <li>Unified constructors and destructors</li>
            <li>Private, public and protected variables and functions</li>
            <li>Nested classes and namespaces (class rdbms::MySQL)</li>
            <li>Exceptions</li>
            <li>Static class variables</li>
            <li>Abstract classes and methods</li>
            <li>Class constants</li>
          </ul>
          
          Although backwards compatibility has been tried to preserve, some changes are 
          necessary. This document explains what has to be done in order to get source code 
          written using the XP framework to run with the Zend Engine 2.
          
          <box caption="Note">
            Only those XP framework classes which cannot be automatically migrated are 
            checked in to the CVS module <tt>skeleton2</tt>. Don't be surprised to find
            only a couple of files there.
          </box>
        </text>
      </para>
      <para>
        <caption>Changes: Exception syntax (mandatory)</caption>
        <text>
          Exceptions are now built-in:
          <code><![CDATA[  // XP1
  function operation() {
    // ...
    if (!$condition) return throw(new Exception('Error'));
    // ...
  }
  
  try(); {
    operation();
  } if (catch('Exception', $e)) {
    $e->printStackTrace();
    exit();
  } 
  
  // XP2
  function operation() {
    // ...
    if (!$condition) throw(new Exception('Error'));
    // ...
  }
  
  try {
    operation();
  } catch (Exception $e) {
    $e->printStackTrace();
    exit();
  } ]]></code>
          In order to make exceptions work, existing sourcecode must be changed - it would
          otherwise result in parse errors. A little script, <tt>migrate_php5.php</tt>, assists
          you here.
        </text>
      </para>              
      <para>
        <caption>Changes: Exception API</caption>
        <text>
          The <ref type="api:class" link="lang.Exception#getStackTrace"/> method no longer 
          returns a string. The return type has been replaced by an array of
          StackTraceElements.
          <br/><br/>
          Use the <tt>toString</tt> method to retrieve a string representation of the
          exception instead.
        </text>
      </para>              
      <para>
        <caption>Changes: Dereferencing</caption>
        <text>
          Dereferencing allows nicer syntax like this:
          <code><![CDATA[  // XP1
  $l= &Logger::getInstance();
  $cat= &$l->getCategory();
  
  // XP2
  $cat= Logger::getInstance()->getCategory();]]></code> 
          The first notation will still work, though (even with the ampersand signs in it), so
          it is up to you to decide whether you want to migrate your code or not.
        </text>
      </para>
    </content>
  </main>
</document>
<commit_msg>- Remove section "Changes: Exception API" - it has already been migrated - Correct information on where to find skeleton2, it`s been moved to experiments/skeleton2<commit_after><?xml version="1.0" encoding="iso-8859-1"?>
<document title="XP::About::Future">
  <main>
    <references>
      <ref link="about">Introduction</ref>
      <ref type="ext" link="http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES?r=head">Changes in the Zend Engine 2.0</ref>
      <ref type="ext" link="http://www.phpmag.de/itr/online_artikel/show.php3?id=207&amp;nodeid=62">Generationenwechsel [Zend Engine 2: Leistungsmerkmale, Geschichte und Designmaximen]</ref>
    </references>
    <content>
      <title>The future of XP</title>
      <editor>$Id$</editor>
      
      <para>
        <caption>The Zend Engine 2</caption>
        <text>
          In the Zend Engine 2 [ZE2], the object model has been largely rewritten. A short overview
          of the new functionality:
          
          <ul>
            <li>Objects are passed by handle, not by value.</li>
            <li>Unified constructors and destructors</li>
            <li>Private, public and protected variables and functions</li>
            <li>Nested classes and namespaces (class rdbms::MySQL)</li>
            <li>Exceptions</li>
            <li>Static class variables</li>
            <li>Abstract classes and methods</li>
            <li>Class constants</li>
          </ul>
          
          Although backwards compatibility has been tried to preserve, some changes are 
          necessary. This document explains what has to be done in order to get source code 
          written using the XP framework to run with the Zend Engine 2.
          
          <box caption="Note">
            Only those XP framework classes which cannot be automatically migrated are 
            checked in to the the CVS module <tt>experiments</tt>' subdirectory 
            <tt>skeleton2</tt>. Don't be surprised to find only a couple of files 
            there.
          </box>
        </text>
      </para>
      <para>
        <caption>Changes: Exception syntax (mandatory)</caption>
        <text>
          Exceptions are now built-in:
          <code><![CDATA[  // XP1
  function operation() {
    // ...
    if (!$condition) return throw(new Exception('Error'));
    // ...
  }
  
  try(); {
    operation();
  } if (catch('Exception', $e)) {
    $e->printStackTrace();
    exit();
  } 
  
  // XP2
  function operation() {
    // ...
    if (!$condition) throw(new Exception('Error'));
    // ...
  }
  
  try {
    operation();
  } catch (Exception $e) {
    $e->printStackTrace();
    exit();
  } ]]></code>
          In order to make exceptions work, existing sourcecode must be changed - it would
          otherwise result in parse errors. A little script, <tt>migrate_php5.php</tt>, assists
          you here.
        </text>
      </para>              
      <para>
        <caption>Changes: Dereferencing</caption>
        <text>
          Dereferencing allows nicer syntax like this:
          <code><![CDATA[  // XP1
  $l= &Logger::getInstance();
  $cat= &$l->getCategory();
  
  // XP2
  $cat= Logger::getInstance()->getCategory();]]></code> 
          The first notation will still work, though (even with the ampersand signs in it), so
          it is up to you to decide whether you want to migrate your code or not.
        </text>
      </para>
    </content>
  </main>
</document>

{'fraction_non_alphanumeric': 0.12412733873219771, 'fraction_numerical': 0.007819044959508517, 'mean_word_length': 2.1430451952610796, 'pattern_counts': {'":': 0, '<': 150, '<?xml version=': 2, '>': 158, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '240126', 'n_tokens_mistral': 2077, 'n_tokens_neox': 2002, 'n_words': 653}