[PHP-DOC] cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml

2006-02-17 Thread Jakub Vrana
vrana   Fri Feb 17 12:33:11 2006 UTC

  Modified files:  
/phpdoc/en/reference/strings/functions  stripos.xml strpos.xml 
strrpos.xml 
  Log:
  False doesn't cause mixed (howto/working)
  
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/strings/functions/stripos.xml?r1=1.8r2=1.9diff_format=u
Index: phpdoc/en/reference/strings/functions/stripos.xml
diff -u phpdoc/en/reference/strings/functions/stripos.xml:1.8 
phpdoc/en/reference/strings/functions/stripos.xml:1.9
--- phpdoc/en/reference/strings/functions/stripos.xml:1.8   Fri Feb 17 
12:17:20 2006
+++ phpdoc/en/reference/strings/functions/stripos.xml   Fri Feb 17 12:33:11 2006
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.8 $ --
+!-- $Revision: 1.9 $ --
   refentry id=function.stripos
refnamediv
 refnamestripos/refname
@@ -10,7 +10,7 @@
refsect1
 titleDescription/title
  methodsynopsis
-  typemixed/typemethodnamestripos/methodname
+  typeint/typemethodnamestripos/methodname
   
methodparamtypestring/typeparameterhaystack/parameter/methodparam
   
methodparamtypestring/typeparameterneedle/parameter/methodparam
   methodparam 
choice=opttypeint/typeparameteroffset/parameter/methodparam
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/strings/functions/strpos.xml?r1=1.9r2=1.10diff_format=u
Index: phpdoc/en/reference/strings/functions/strpos.xml
diff -u phpdoc/en/reference/strings/functions/strpos.xml:1.9 
phpdoc/en/reference/strings/functions/strpos.xml:1.10
--- phpdoc/en/reference/strings/functions/strpos.xml:1.9Fri Feb 17 
12:17:20 2006
+++ phpdoc/en/reference/strings/functions/strpos.xmlFri Feb 17 12:33:11 2006
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.9 $ --
+!-- $Revision: 1.10 $ --
 !-- splitted from ./en/functions/strings.xml, last change in rev 1.8 --
   refentry id=function.strpos
refnamediv
@@ -11,7 +11,7 @@
refsect1
 titleDescription/title
  methodsynopsis
-  typemixed/typemethodnamestrpos/methodname
+  typeint/typemethodnamestrpos/methodname
   
methodparamtypestring/typeparameterhaystack/parameter/methodparam
   
methodparamtypemixed/typeparameterneedle/parameter/methodparam
   methodparam 
choice=opttypeint/typeparameteroffset/parameter/methodparam
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/strings/functions/strrpos.xml?r1=1.11r2=1.12diff_format=u
Index: phpdoc/en/reference/strings/functions/strrpos.xml
diff -u phpdoc/en/reference/strings/functions/strrpos.xml:1.11 
phpdoc/en/reference/strings/functions/strrpos.xml:1.12
--- phpdoc/en/reference/strings/functions/strrpos.xml:1.11  Fri Feb 17 
12:17:20 2006
+++ phpdoc/en/reference/strings/functions/strrpos.xml   Fri Feb 17 12:33:11 2006
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=iso-8859-1?
-!-- $Revision: 1.11 $ --
+!-- $Revision: 1.12 $ --
 !-- splitted from ./en/functions/strings.xml, last change in rev 1.8 --
   refentry id=function.strrpos
refnamediv
@@ -11,7 +11,7 @@
refsect1
 titleDescription/title
  methodsynopsis
-  typemixed/typemethodnamestrrpos/methodname
+  typeint/typemethodnamestrrpos/methodname
   
methodparamtypestring/typeparameterhaystack/parameter/methodparam
   
methodparamtypestring/typeparameterneedle/parameter/methodparam
   methodparam 
choice=opttypeint/typeparameteroffset/parameter/methodparam


Re: [PHP-DOC] cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml

2006-02-17 Thread Nuno Lopes

vrana Fri Feb 17 12:33:11 2006 UTC

 Modified files:
   /phpdoc/en/reference/strings/functions stripos.xml strpos.xml
 strrpos.xml
 Log:
 False doesn't cause mixed (howto/working)


Yeah I know! I've already read/change it several times.

Quoting howto:
Do not use mixed, if the return value is of a certain (not boolean) type, 
and FALSE only on error. Provide the primary return type as the return type 
of the function, and write down in the explanation, that it returns FALSE on 
error. Use return.success; if the function returns TRUE on success, and 
FALSE on failure.


These functions return FALSE on normal operation, not on error. 
mysql_connect() for example returns a resource on success or false on 
failure. there you shoudn't use mixed.
In this case, the return of false means not found, not a error, ence the use 
of mixed. (those pages even have the entity to explain how to use the === 
operator..)



Nuno 


Re: [PHP-DOC] cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml

2006-02-17 Thread Jakub Vrana
Nuno Lopes wrote:
 These functions return FALSE on normal operation, not on error.
 mysql_connect() for example returns a resource on success or false on
 failure. there you shoudn't use mixed.
 In this case, the return of false means not found, not a error, ence the use
 of mixed. (those pages even have the entity to explain how to use the ===
 operator..)

Maybe you are right. I don't like mixed as you don't know what it
usually returns without reading the docs. String not found can be
also interpreted as a kind of an error.

If you persist on your interpretation and others agree, go ahead and
commit it again and let me sorry for my bogus reversion.

Jakub Vrana


Re: [PHP-DOC] cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml

2006-02-17 Thread Friedhelm Betz

Nuno Lopes wrote:

vrana Fri Feb 17 12:33:11 2006 UTC

 Modified files:
   /phpdoc/en/reference/strings/functions stripos.xml strpos.xml
 strrpos.xml
 Log:
 False doesn't cause mixed (howto/working)


Yeah I know! I've already read/change it several times.

Quoting howto:
Do not use mixed, if the return value is of a certain (not boolean) 
type, and FALSE only on error. Provide the primary return type as the 
return type of the function, and write down in the explanation, that it 
returns FALSE on error. Use return.success; if the function returns 
TRUE on success, and FALSE on failure.


These functions return FALSE on normal operation, not on error. 
mysql_connect() for example returns a resource on success or false on 
failure. there you shoudn't use mixed.
In this case, the return of false means not found, not a error, ence the 
use of mixed. (those pages even have the entity to explain how to use 
the === operator..)


Hm, that's arguable. I might argue, that the main purpose is to find the 
position in a given string: normal operation. If not found, this might 
be an error or failure.


Friedhelm


Re: [PHP-DOC] cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml

2006-02-17 Thread Nuno Lopes

Nuno Lopes wrote:
 These functions return FALSE on normal operation, not on error.
 mysql_connect() for example returns a resource on success or false on
 failure. there you shoudn't use mixed.
 In this case, the return of false means not found, not a error, ence the 
 use
 of mixed. (those pages even have the entity to explain how to use the 
 ===

 operator..)

Maybe you are right. I don't like mixed as you don't know what it
usually returns without reading the docs. String not found can be
also interpreted as a kind of an error.

If you persist on your interpretation and others agree, go ahead and
commit it again and let me sorry for my bogus reversion.

Jakub Vrana



I don't particularly like 'mixed' either.. And this would probably 
complicate your script for proto checking :)

So, I'll leave it as-is, as so far no one seemed to agree with me.

Nuno