rfc:dbc2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:dbc2 [2015/02/10 12:59] krakjoerfc:dbc2 [2018/03/01 23:19] (current) – Typo "Under Discussion" carusogabriel
Line 3: Line 3:
   * Date: 2015-02-10   * Date: 2015-02-10
   * Author: Yasuo Ohgaki <yohgaki@ohgaki.net>, Dmitry Stogov <dmitry@zend.com>, Joe Watkins <pthreads@pthreads.org>   * Author: Yasuo Ohgaki <yohgaki@ohgaki.net>, Dmitry Stogov <dmitry@zend.com>, Joe Watkins <pthreads@pthreads.org>
-  * Status: Draft+  * Status: Under Discussion
   * First Published at: http://wiki.php.net/rfc/dbc2   * First Published at: http://wiki.php.net/rfc/dbc2
  
 ===== Important Note ===== ===== Important Note =====
 +
 +This RFC is part of "Design by Contract Introduction" RFC
 +  * https://wiki.php.net/rfc/introduce_design_by_contract
  
 This RFC is an alternative approach to "Native DbC support" RFC. This RFC is an alternative approach to "Native DbC support" RFC.
-http://wiki.php.net/rfc/dbc+  * http://wiki.php.net/rfc/dbc
  
 Contracts can be defined without modification to the language, however, the D documentation calls the resulting implementation "clumsy and inconsistent". Contracts can be defined without modification to the language, however, the D documentation calls the resulting implementation "clumsy and inconsistent".
Line 70: Line 73:
 ===== Invariant ===== ===== Invariant =====
  
-Invariant contracts are declared using **require** inside class body. Multiple contracts may be used. They may access object or static properties through **$this** and **self**. Invariant contracts may be used for classes, abstract classes and traits, but not for interfaces.+Invariant contracts are declared using **require** inside class body. Multiple invariant contracts may be used. They may access object or static properties through **$this** and **self**. Invariant contracts may be used for classes, abstract classes and traits, but not for interfaces.
  
 <code> <code>
Line 82: Line 85:
  }  }
  
- requre($this->sum > 0, "overflow detected");+ require($this->sum > 0, "overflow detected");
 } }
 </code> </code>
Line 147: Line 150:
   * dbc=zero_cost - don't generate code for contracts. This may be set only in php.ini and can't be changed through ini_set().   * dbc=zero_cost - don't generate code for contracts. This may be set only in php.ini and can't be changed through ini_set().
  
-  The default value if "off".+  The default value is "off".
  
 ===Contracts Execution Order=== ===Contracts Execution Order===
rfc/dbc2.1423573145.txt.gz · Last modified: 2017/09/22 13:28 (external edit)