[PHP-DOC] #40137 [Opn]: in-function-call variable-define bug
ID: 40137 Updated by: [EMAIL PROTECTED] Reported By: kolypto at mail dot ru Status: Open -Bug Type: Variables related +Bug Type: Documentation problem Operating System: WinXP PHP Version: 5.2.0 New Comment: Then it should be fixed in the docs. Previous Comments: [2007-02-04 15:21:18] kolypto at mail dot ru Found another thing, in manual: int socket_select ( array &read, array &write, array &except, int tv_sec [, int tv_usec] ) here's the amps before variables, that's exactly the same as spoken above. And what we see next, in manual? $num_changed_sockets = socket_select($read, $write = NULL, $except = NULL, 0); so, the "bug" i'm complaining above is really strange... [2007-01-16 21:50:55] kolypto at mail dot ru Okay, i'll note that from 5.0.4 php has silently changed its behavior... [2007-01-16 08:27:48] [EMAIL PROTECTED] Turn on error messages and see the error message you're missing: "Strict Standards: Only variables should be passed by reference" "$a='IN'" is not a variable, it's an expression and expressions cannot be passed by reference. No bug here. [2007-01-16 03:42:37] kolypto at mail dot ru In php4 and php 5.0.4 it is: In function:IN MOD In php > 5.0.4 it works like you're saying that's the question =) [2007-01-16 03:31:25] judas dot iscariote at gmail dot com sigh. lets see.. function modify(&$str1) { print "\n".'In function:'.$str1; $str1='MOD'; } // the variable $a is locally **defined** with value "IN" modify($a='IN'); //this prints 'In function: IN' (as expected) print "\n".$a; // $a is **already defined** as 'IN', hence it SHOULD print 'IN' **not** MOD wth are you talking about ?? works as expected. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/40137 -- Edit this bug report at http://bugs.php.net/?id=40137&edit=1
[PHP-DOC] result_identifier, result_id or result?
Hi, within the mssql functions there are three different names for the same parameter: result_identifier, result_id, and result. Which one is to prefer? Cheers, Martin
[PHP-DOC] cvs: phpdoc /en/reference/mssql/functions mssql-bind.xml
samesch Mon Feb 12 15:00:25 2007 UTC Modified files: /phpdoc/en/reference/mssql/functionsmssql-bind.xml Log: grammar: word order http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-bind.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-bind.xml diff -u phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.10 phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.11 --- phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.10 Mon Feb 12 09:37:43 2007 +++ phpdoc/en/reference/mssql/functions/mssql-bind.xml Mon Feb 12 15:00:25 2007 @@ -1,5 +1,5 @@ - + mssql_bind @@ -44,8 +44,8 @@ You have to include the @ character, like in the -T-SQL syntax. See the included in mssql_execute -explanation. +T-SQL syntax. See the explanation included in +mssql_execute.
[PHP-DOC] cvs: phpdoc /en/reference/ingres-ii reference.xml
grantc Mon Feb 12 13:58:55 2007 UTC Modified files: /phpdoc/en/reference/ingres-ii reference.xml Log: Corrected example http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/ingres-ii/reference.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/ingres-ii/reference.xml diff -u phpdoc/en/reference/ingres-ii/reference.xml:1.10 phpdoc/en/reference/ingres-ii/reference.xml:1.11 --- phpdoc/en/reference/ingres-ii/reference.xml:1.10Wed Oct 25 17:34:56 2006 +++ phpdoc/en/reference/ingres-ii/reference.xml Mon Feb 12 13:58:55 2007 @@ -1,5 +1,5 @@ - + @@ -70,7 +70,7 @@ // relid - table name // relowner - table owner echo "\n"; -while ($iirelation = ingres_fetch_object($link)) { +while ($iirelation = ingres_fetch_object(INGRES_BOTH, $link)) { echo "\t\n"; echo "\t\t" . $iirelation->relid . "\n"; echo "\t\t" . $iirelation->relowner . "\n";
Re: [PHP-DOC] docs on migrating to 5.2
HI :) On 2/12/07, Daniel Convissor <[EMAIL PROTECTED]> wrote: Hi Hannes: > You didn't read the release announcement, did you? :) I did, guess I'm dense. "For users upgrading from PHP 5.0 and PHP 5.1, an upgrade guide is available here [link to http://www.php.net/UPDATE_5_2.txt], detailing the changes between those releases and PHP 5.2.1." :) -Hannes > >Question: What are the rules with how the link's are added. Will the > >system automatically figure everything out? Even things like this? > > XMLReader::open > > That depends on the ID of the function/method, this particular case wont > work. Okay, thanks. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
Re: [PHP-DOC] docs on migrating to 5.2
Hi Hannes: > You didn't read the release announcement, did you? :) I did, guess I'm dense. > >Question: What are the rules with how the link's are added. Will the > >system automatically figure everything out? Even things like this? > > XMLReader::open > > That depends on the ID of the function/method, this particular case wont > work. Okay, thanks. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
[PHP-DOC] cvs: phpdoc /en/reference/swish/functions swishresult-stem.xml
tony2001Mon Feb 12 10:54:54 2007 UTC Modified files: /phpdoc/en/reference/swish/functionsswishresult-stem.xml Log: clarify what exactly is in the result array http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishresult-stem.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/swish/functions/swishresult-stem.xml diff -u phpdoc/en/reference/swish/functions/swishresult-stem.xml:1.1 phpdoc/en/reference/swish/functions/swishresult-stem.xml:1.2 --- phpdoc/en/reference/swish/functions/swishresult-stem.xml:1.1Fri Feb 9 13:35:21 2007 +++ phpdoc/en/reference/swish/functions/swishresult-stem.xmlMon Feb 12 10:54:54 2007 @@ -1,5 +1,5 @@ - + SwishResult->stem @@ -35,9 +35,7 @@ &reftitle.returnvalues; - Returns array of results, in most cases with just one element. - If the stemmer used does not convert the word, the result array will - contain the original word. + Returns array containing the stemmed word variants (usually just one).
[PHP-DOC] cvs: phpdoc /en/reference/swish reference.xml
tony2001Mon Feb 12 10:52:54 2007 UTC Modified files: /phpdoc/en/reference/swish reference.xml Log: more examples http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/reference.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/swish/reference.xml diff -u phpdoc/en/reference/swish/reference.xml:1.1 phpdoc/en/reference/swish/reference.xml:1.2 --- phpdoc/en/reference/swish/reference.xml:1.1 Fri Feb 9 13:35:21 2007 +++ phpdoc/en/reference/swish/reference.xml Mon Feb 12 10:52:54 2007 @@ -1,5 +1,5 @@ - + @@ -38,6 +38,60 @@ &reftitle.runtime; &no.config; + + &reftitle.examples; + + + Basic search query + + + + + + The above example will output something like this: + + + + &reference.swish.constants; &reference.swish.classes;
[PHP-DOC] cvs: phpdoc /en/reference/swish constants.xml /en/reference/swish/functions swishsearch-setstructure.xml
tony2001Mon Feb 12 10:42:39 2007 UTC Modified files: /phpdoc/en/reference/swish constants.xml /phpdoc/en/reference/swish/functionsswishsearch-setstructure.xml Log: update docs http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/swish/constants.xml diff -u phpdoc/en/reference/swish/constants.xml:1.1 phpdoc/en/reference/swish/constants.xml:1.2 --- phpdoc/en/reference/swish/constants.xml:1.1 Fri Feb 9 13:35:21 2007 +++ phpdoc/en/reference/swish/constants.xml Mon Feb 12 10:42:39 2007 @@ -1,12 +1,12 @@ - + &reftitle.constants; &extension.constants; -SWISH_META_TYPE_UNDEF +Swish::META_TYPE_UNDEF (integer) @@ -16,7 +16,7 @@ -SWISH_META_TYPE_STRING +Swish::META_TYPE_STRING (integer) @@ -26,7 +26,7 @@ -SWISH_META_TYPE_ULONG +Swish::META_TYPE_ULONG (integer) @@ -36,7 +36,7 @@ -SWISH_META_TYPE_DATE +Swish::META_TYPE_DATE (integer) @@ -46,7 +46,7 @@ -SWISH_IN_FILE_BIT +Swish::IN_FILE_BIT (integer) @@ -56,7 +56,7 @@ -SWISH_IN_TITLE_BIT +Swish::IN_TITLE_BIT (integer) @@ -66,7 +66,7 @@ -SWISH_IN_HEAD_BIT +Swish::IN_HEAD_BIT (integer) @@ -76,7 +76,7 @@ -SWISH_IN_BODY_BIT +Swish::IN_BODY_BIT (integer) @@ -86,7 +86,7 @@ -SWISH_IN_COMMENTS_BIT +Swish::IN_COMMENTS_BIT (integer) @@ -96,7 +96,7 @@ -SWISH_IN_HEADER_BIT +Swish::IN_HEADER_BIT (integer) @@ -106,7 +106,7 @@ -SWISH_IN_EMPHASIZED_BIT +Swish::IN_EMPHASIZED_BIT (integer) @@ -116,7 +116,7 @@ -SWISH_IN_META_BIT +Swish::IN_META_BIT (integer) @@ -126,7 +126,7 @@ -SWISH_IN_FILE +Swish::IN_FILE (integer) @@ -136,7 +136,7 @@ -SWISH_IN_TITLE +Swish::IN_TITLE (integer) @@ -146,7 +146,7 @@ -SWISH_IN_HEAD +Swish::IN_HEAD (integer) @@ -156,7 +156,7 @@ -SWISH_IN_BODY +Swish::IN_BODY (integer) @@ -166,7 +166,7 @@ -SWISH_IN_COMMENTS +Swish::IN_COMMENTS (integer) @@ -176,7 +176,7 @@ -SWISH_IN_HEADER +Swish::IN_HEADER (integer) @@ -186,7 +186,7 @@ -SWISH_IN_EMPHASIZED +Swish::IN_EMPHASIZED (integer) @@ -196,7 +196,7 @@ -SWISH_IN_META +Swish::IN_META (integer) @@ -206,7 +206,7 @@ -SWISH_IN_ALL +Swish::IN_ALL (integer) http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml diff -u phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml:1.1 phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml:1.2 --- phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml:1.1 Fri Feb 9 16:57:06 2007 +++ phpdoc/en/reference/swish/functions/swishsearch-setstructure.xmlMon Feb 12 10:42:39 2007 @@ -1,5 +1,5 @@ - + SwishSearch->setStructure @@ -33,42 +33,42 @@ - SWISH_IN_FILE + Swish::IN_FILE - SWISH_IN_TITLE + Swish::IN_TITLE - SWISH_IN_HEAD + Swish::IN_HEAD - SWISH_IN_BODY + Swish::IN_BODY - SWISH_IN_COMMENTS + Swish::IN_COMMENTS - SWISH_IN_HEADER + Swish::IN_HEADER - SWISH_IN_EMPHASIZED + Swish::IN_EMPHASIZED - SWISH_IN_META + Swish::IN_META @@ -91,11 +91,11 @@ $results = $search->execute("time"); echo "First query found: ", $results->hits, " hits\n"; -$search->setStructure(SWISH_IN_TITLE|SWISH_IN_HEAD); //search in title and head +$search->setStructure(Swish::IN_TITLE|Swish::IN_HEAD); //search in title and head $results = $search->execute("time"); echo "Second query found: ", $results->hits, " hits\n"; -$search->setStructure(SWISH_IN_ALL); //search in whole document, the default value +$search->setStructure(Swish::IN_ALL); //search in whole document, the default value $results = $search->execute("time"); echo "Third query found: ", $results->hits, " hits\n";
Re: [PHP-DOC] docs on migrating to 5.2
Hi Daniel On 2/12/07, Daniel Convissor <[EMAIL PROTECTED]> wrote: Hi Folks: I was looking through the manual for info on upgrading to 5.2 and found nothing. With some good Googling I found http://www.php.net/UPDATE_5_2.txt. You didn't read the release announcement, did you? :) Of course, it's best to have stuff in the manual, so I took the text from UPDATE_5_2.txt and formatted it like en/appendices/migrating5.xml. I'm nearly done and will open a bug in the near future with a link to the uploaded file. You will be loved for it, it has been on our todo list since the release of 5.2.0. (_NOW_ :)) I noticed that the documentation build system automatically transforms function_name into the function with a link to the function's documentation. Very nice! From all the work on the PEAR docs, I'm used to having to manually put in the 's around the 's so had been putting them. Question: What are the rules with how the link's are added. Will the system automatically figure everything out? Even things like this? XMLReader::open That depends on the ID of the function/method, this particular case wont work. In general method IDs are in the form of: function.classname-method The ID of XMLReader::open is function.xmlreader-open ergo => xmlreader-open would work. Note that the IDs (and therefor ) are case-insensitive, but please be consistent with what is used in docs for that method/function. -Hannes I don't want to undo all of the effort of manually putting in all of the 's so far only to find out they're needed in some cases. Please cc me, I'm not on [EMAIL PROTECTED] Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
[PHP-DOC] cvs: phpdoc /en/reference/mssql/functions mssql-bind.xml mssql-select-db.xml
samesch Mon Feb 12 09:37:43 2007 UTC Modified files: /phpdoc/en/reference/mssql/functionsmssql-bind.xml mssql-select-db.xml Log: fix: role examples http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-bind.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-bind.xml diff -u phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.9 phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.10 --- phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.9 Sun Feb 4 22:46:04 2007 +++ phpdoc/en/reference/mssql/functions/mssql-bind.xml Mon Feb 12 09:37:43 2007 @@ -1,5 +1,5 @@ - + mssql_bind @@ -113,8 +113,8 @@ - - &reftitle.returnvalues; + + &reftitle.examples; mssql_bind Example http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-select-db.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-select-db.xml diff -u phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.8 phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.9 --- phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.8 Sun Feb 4 22:46:05 2007 +++ phpdoc/en/reference/mssql/functions/mssql-select-db.xml Mon Feb 12 09:37:43 2007 @@ -1,5 +1,5 @@ - + mssql_select_db @@ -69,8 +69,8 @@ - - &reftitle.returnvalues; + + &reftitle.examples; mssql_select_db example
[PHP-DOC] Improving the documentation - Missing examples - An idea.
> -Original Message- > From: Philip Olson [mailto:[EMAIL PROTECTED] > Sent: Sunday, February 11, 2007 7:10 AM > To: Rasmus Lerdorf > Cc: Ronald Chmara; Mehdi Achour; internals@lists.php.net; > phpdoc@lists.php.net > Subject: Re: [PHP-DOC] Re: [PHP-DEV] Re: [PHP-DOC] Improving > the documentation > Those ideas about doing more are nice because the DOC tag is > a good start but additional collaboration is needed. Part of > the documentation teams job can easily be organizing > information requests so the developers can work efficiently. > If that means, as suggested above, periodic updates then > we'll for sure do it. A few come to mind already. It's > exciting to see this thread blossom! I hope everyone feels > free to brainstorm... ALL ideas are welcome! All ideas? With regard to missing examples, how about incorporating some of the unit tests? >From what I understand, one of the purposes of unit testing is to actually test the function/method and to make sure it still works after amendments to the code. So, if it is good enough for unit testing, how much effort is it to use them as an example? Admittedly, the bigger picture could be missing. So, as developers want to write code (in preference to writing documentation), if they were able to provide working examples, rather than wordy documentation, at least there would be some PHP (rather than C) code available for the documentors to see what is going on and how things work. I assume the developers test their own code so they must have SOME PHP examples. If these where named according to something like this ... /php-src/ext/module/examples/function_nn.php /php-src/ext/module/examples/extension_nn.php Where : ext is the name of the extension, function is the name of the function or method, nn is a simple count (01, 02, 03, etc) extension is for more global examples that would appear on the ext's main page rather than on a function/method page These examples COULD include a tag or a comment for versioning. The idea here is to allow the developers to show the world using PHP what their extension does. They say a picture is worth a thousand words. I think, in some cases, an example would also work. Ideally, the examples should also include some output (that's the hard part) so the example could be cut'n'pasted and tested and the user could see that the output matches. A little bit sort of like a unit test. Then the documentation team could see proper/expected usage. It COULD also make more unit tests available. If the developers primary language is NOT English, then that's not an issue as the PHP language would be the common denominator. By having the examples as separate files, they could actually be tested to make sure they work (not exactly sure how to automate this). Capturing output could also be done automatically. Image function examples could create the images used for the manual, etc. The possibilities are endless. And the start point is to get developers to write a little bit more code rather than writing documentation. Regards, Richard Quadling.