note 108464 deleted from function.imagettfbbox by danbrown

From: Date: Thu, 10 May 2012 16:56:57 +0000
Subject: note 108464 deleted from function.imagettfbbox by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187616@lists.php.net to get a copy of this message
Note Submitter: BobsForumReplies at yahoo dot com ---- I tried the example provided by jodybrabec at gmail dot com 30-Aug-2011 03:39 and had to do some debugging. The statement: imagefill($image, imagecolorallocate($image,200,200,200)); was producing an error message which said that the imagefill function requires four arguments and only two were provided. When I added the missing arguments, the x and y values, the example worked. I set x and y to zero (0). There is another example on the page that uses the same statement. After finding this problem and having encountered others in other examples of various functions, I have a question-- Does anyone actually test the code they post? Or, perhaps the PHP they are using is different than the PHP I'm using - or perhaps configured differently. Is a version/configuration/setup, etc. which would allow the statement: imagefill($image, imagecolorallocate($image,200,200,200)); to work properly - I rather doubt it because if you don't code all the arguments (or NULL or include the commas for them as in other languages) how is the function going to "know" which arguments were omitted and what default value should be used? BTW - the word "parameter" is being used here where I would use the word "argument" - and, if precedent is to be used, "argument" has been around a bit longer than I've been at this business (I started in 1972) and that is what I use to refer to the "things" you pass to a function. Back to my main question - do people test the actual code they post? I've seen an awful lot of examples that need debugging before they will work. I'm just curious about this because the last thing someone trying to learn a new language or function needs is an example with bugs. Bob

« previous php.notes (#187616) next »