philip          Mon May 24 17:53:23 2004 EDT

  Modified files:              
    /phpdoc/en/reference/classobj/functions     is-a.xml 
  Log:
  Mention (with an example) that is_a() is deprecated in PHP 5 in favor of the
  instanceof operator.  This deals with bug #27503
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/classobj/functions/is-a.xml?r1=1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/classobj/functions/is-a.xml
diff -u phpdoc/en/reference/classobj/functions/is-a.xml:1.6 
phpdoc/en/reference/classobj/functions/is-a.xml:1.7
--- phpdoc/en/reference/classobj/functions/is-a.xml:1.6 Tue Feb 24 11:28:22 2004
+++ phpdoc/en/reference/classobj/functions/is-a.xml     Mon May 24 17:53:23 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
 <!-- splitted from ./en/functions/classobj.xml, last change in rev 1.33 -->
  <refentry id="function.is-a">
    <refnamediv>
@@ -42,6 +42,26 @@
 ]]>
         </programlisting>
       </example>
+    </para>
+    <para>
+     The <function>is_a</function> function is deprecated as of PHP 5 in
+     favor of the <link linkend="language.operators.type">instanceof</link>
+     type operator.  In the above example we could use the following in
+     PHP 5:
+    </para>
+    <para>
+     <example>
+      <title>Using the <emphasis>instanceof</emphasis> operator in PHP 5</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+if ($WF instanceof WidgetFactory) {
+    echo 'Yes, $WF is a WidgetFactory';
+}
+?>
+]]>
+      </programlisting>
+     </example>
     </para>
     <simpara>
      See also <function>get_class</function>, 

Reply via email to