Re: cvs: phpdoc /en/reference/misc/functions define.xml
| From: | Hannes Magnusson | Date: | Fri, 27 Apr 2007 15:37:24 +0000 |
| Subject: | Re: cvs: phpdoc /en/reference/misc/functions define.xml | ||
| References: | 1 2 3 4 5 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969376184@lists.php.net to get a copy of this message | ||
On 4/27/07, M.Sokolewicz <tularis@php.net> wrote:
hmm, I guess we should make a note of it. Though the __toString() method will only work in php 5.2.0+ (I've just tested it on 4.4.6 (which obviously didn't work... d'oh...) and 5.1.3 (which returned an error)).Right. __toString() simply didn't work before PHP5.2.0 - and I think define() didn't use __toString() untill 5.2.1 (I'll have to look it up though, not 100% sure). -Hannes
- tul Etienne Kneuss wrote: I agree it should be documented, as object to string conversion is not always automatic. example: $array[$object] = 2; Regards Richard A. Quadling wrote:-----Original Message----- From: Hannes Magnusson [mailto:hannes.magnusson@gmail.com] Sent: 27 April 2007 13:41 To: Maciek Sokolewicz Cc: phpdoc@lists.php.net Subject: Re: [PHP-DOC] cvs: phpdoc /en/reference/misc/functions define.xml Should we mention that define() also accepts objects with __toString() implemented.. or is that generally expected? -HannesHa! That does got completely against what the dox currently say. It should be documented with an appropriate example otherwise users may read it as supporting ANY object, not just those with a __toString() method. Maybe document both class types - with and without a __toString() method to really drive the point home. Richard.On 4/27/07, Maciek Sokolewicz <tularis@php.net> wrote:http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/misc/functions/defintularis Fri Apr 27 11:10:29 2007 UTCModified files:/phpdoc/en/reference/misc/functions define.xmlLog: define() also allows null and boolean valuese.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/misc/functions/define.xml diff -u phpdoc/en/reference/misc/functions/define.xml:1.9phpdoc/en/reference/misc/functions/define.xml:1.10--- phpdoc/en/reference/misc/functions/define.xml:1.9 FriApr 27 07:54:37 2007Apr 27 11:10:29 2007+++ phpdoc/en/reference/misc/functions/define.xml Fri@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry id="function.define"> <refnamediv> <refname>define</refname> @@ -35,7 +35,9 @@is <type>integer</type>s, <type>float</type>s and <type>string</type>s are allowed.<term><parameter>value</parameter></term> <listitem> <para> - The value of the constant; only scalar values, that<type>null</type> values are allowed.+ The value of the constant; only scalar and<type>boolean</type> values.+ Scalar values are <type>integer</type>, + <type>float</type>, <type>string</type> or</para> </listitem> </varlistentry>