Re: Re: Bug #16739 Updated: `print' variable function call
| From: | Yasuo Ohgaki | Date: | Sat, 11 May 2002 02:04:07 +0000 |
| Subject: | Re: Re: Bug #16739 Updated: `print' variable function call | ||
| References: | 1 2 | Groups: | php.dev php.doc |
| Request: | Send a blank email to php-dev+get-83888@lists.php.net to get a copy of this message | ||
derick@php.net wrote:
On Fri, 10 May 2002, brad lafountain wrote:I understand you are talking about technical issue. However, I would like to memntion documentaton issue. PHP manual is missing language core design documentation. 1) Tokens/Reserved words 2) BNF 3) Reserved method names (__method?) From users point of view, print is function and supposed to work as if it is function unless there is documentation for 1) and 2). IMHO, we need someone who documents language design.... -- Yasuo OhgakiI dont' think its too much of a mess PHP_FUNCTION(echo) { char *mess; int mess_len; if(zend_parse_parameters(*) == SUCCESS) php_write(buf, size TSRMLS_CC); } What you gain is allowing people to do the following code and you don't get posts up here saying this and that dont work properly.1. You get ambigiuty in the parser, so your function will only work when called indirectly. 2. echo as language contruct works fine 3. You can easily make a wrapper in PHP
Derick--------------------------------------------------------------------------- Did I help you? http://www.jdimedia.nl/derick/link.php?url=giftlist Frequent ranting: http://www.jdimedia.nl/derick/ ---------------------------------------------------------------------------__________________________________________________ Do You Yahoo!? Yahoo! Shopping - Mother's Day is May 12th! http://shopping.yahoo.com -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.phpremoveOn Fri, 10 May 2002, Markus Fischer wrote:Hi, can someone state the technical problems we're facing? I'ld rather see this documented (whether it works or no, but documenting).print is implemented in the scanner level as token (T_PRINT) and that prohibits it for use as function. It's only a problem if we make this a function because of *big sigh* BC issues, print "" works now, but won't work if it's a function. (Only print (""); ). The same is true for echo. DerickOn Fri, May 10, 2002 at 08:04:25AM +0200, Derick Rethans wrote :Hello, as far as I know this never worked, the wisest thing to do is tonot atitfrom the documentation, as I don't see this fixed anytime soon (orhttp://cvs.php.net/diff.php/phpdoc/en/functions/strings.xml?r1=1.164&r2=1.165all). Derick On 10 May 2002 philip@php.net wrote:ID: 16739 Updated by: philip@php.net Reported By: marshall@magpcss.com -Status: Open +Status: Analyzed Bug Type: Variables relatedOperating System: FreeBSD 4.5,RedHat 2.4.7,Win XP-PHP Version: 4.1.2 +PHP Version: 4.3.0-devNew Comment: Confirmed with PHP 4.3.0-dev (cgi) (may 09, 2002) PHP Fatal error: Call to undefined function: print() in... This behavior is documented as working in at least two places. These changes to phpdoc were made on March 05, 2002. So: a) Did this used to work? b) Will it work in the future? c) Should this be documented/undocumented? I'm guessing it never worked but may in the future. In the very least, a version of (c) needs to happen. I can only confirm 4.1.2 through php4-cvs at this time. print:http://cvs.php.net/diff.php/phpdoc/en/language/functions.xml?r1=1.24&r2=1.25Variable functions:The------------------------------------------------------------------------Previous Comments:[2002-04-22 23:54:40] marshall@magpcss.com According to the official PHP documentation [http://www.php.net/manual/en/functions.variable-functions.php] the language construct `print' can be called as a variable function.error:following code should therefore be valid: $myfunc = 'print'; $myfunc('My text to print'); Attempting to execute this code on any platform returns a "Fatal---------------------------------------------------------------------------------------------------------------------------------------------------Call to undefined function: print()" message.-- Edit this bug report at http://bugs.php.net/?id=16739&edit=1---------------------------------------------------------------------------http://www.jdimedia.nl/derick/Derick Rethanshttp://www.jdimedia.nl/JDI Media Solutions----------------------------------------------------------------------------- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php-- Please always Cc to me when replying to me on the lists. GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc "I'm not stupid, you know? :)" - Jani Taskinen -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php---------------------------------------------------------------------------Did I help you? http://www.jdimedia.nl/derick/link.php?url=giftlist Frequent ranting: http://www.jdimedia.nl/derick/---------------------------------------------------------------------------PHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net--------------------------------------------------------------------------- Did I help you? http://www.jdimedia.nl/derick/link.php?url=giftlist Frequent ranting: http://www.jdimedia.nl/derick/ ----------------------------------------------------------------------------- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php__________________________________________________ Do You Yahoo!? Yahoo! Shopping - Mother's Day is May 12th! http://shopping.yahoo.com -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.phpPHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net--------------------------------------------------------------------------- -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.phpPHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net---------------------------------------------------------------------------