php-general Digest 12 Jan 2011 19:45:14 -0000 Issue 7129
php-general Digest 12 Jan 2011 19:45:14 - Issue 7129 Topics (messages 310689 through 310703): Re: First PHP job 310689 by: Gary Re: HTML errors 310690 by: Pete Ford 310691 by: David McGlone 310692 by: David McGlone 310693 by: Steve Staples 310694 by: Richard Quadling 310695 by: Daniel Brown 310696 by: Richard Quadling 310697 by: David McGlone 310698 by: Steve Staples 310699 by: Richard Quadling 310700 by: David Harkness 310701 by: Daniel Brown 310702 by: tedd Array Symbol Suggestion 310703 by: sono-io.fannullone.us Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Peter Lind wrote: On Jan 11, 2011 4:32 PM, Gary wrote: Steve Staples wrote: or the ($needle, $haystack) vs ($haystack, $needle)... i still get it screwed up... Given that, for example, array_search and strstr take those arguments in different orders, that's not really surprising. Something tells me that's what he meant ... I read it that he could never remember which order to put them in. ---End Message--- ---BeginMessage--- On 12/01/11 03:35, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters …omehome/a/lilia href=index.php?page=servicesservices/a/lilia h… I have tried various combinatons and different doctypes. I'm beginning to wonder if this code is allowed at all. All the other replies are talking nonsense (especially Daniel ;) ! There's no reason why HTML with single-quoted attributes isn't valid, so in principle your expected output of a href='index.php?page=services'services/a should be OK. The real challenge is to understand why the code fragment you have presented is losing the single quotes: are you *sure* this is exactly what you have in your file (i.e. have you copied it to the posted message properly) ? -- Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS ---End Message--- ---BeginMessage--- On Wednesday, January 12, 2011 04:14:42 am Pete Ford wrote: On 12/01/11 03:35, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters …omehome/a/lilia href=index.php?page=servicesservices/a/lilia h… I have tried various combinatons and different doctypes. I'm beginning to wonder if this code is allowed at all. All the other replies are talking nonsense (especially Daniel ;) ! There's no reason why HTML with single-quoted attributes isn't valid, so in principle your expected output of a href='index.php?page=services'services/a should be OK. The real challenge is to understand why the code fragment you have presented is losing the single quotes: are you *sure* this is exactly what you have in your file (i.e. have you copied it to the posted message properly) ? Thanks Pete. Funny story. Ya'll better not laugh, especially you Denial, oops I mean Daniel ;-) Anyway, All of us would never have fixed this error. We could have added double quotes, single quotes and every combination even the worlds best programmer would use and it wouldn't have gotten us anywhere. Thats because if your working on the wrong file. :-) -- Blessings David M. ---End Message--- ---BeginMessage--- On Tuesday, January 11, 2011 11:48:33 pm Daniel Brown wrote: On Tue, Jan 11, 2011 at 22:35, David McGlone da...@dmcentral.net wrote: Hi Everyone, I'm having a problem
[PHP] Re: HTML errors
On 12/01/11 03:35, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters …omehome/a/lilia href=index.php?page=servicesservices/a/lilia h… I have tried various combinatons and different doctypes. I'm beginning to wonder if this code is allowed at all. All the other replies are talking nonsense (especially Daniel ;) ! There's no reason why HTML with single-quoted attributes isn't valid, so in principle your expected output of a href='index.php?page=services'services/a should be OK. The real challenge is to understand why the code fragment you have presented is losing the single quotes: are you *sure* this is exactly what you have in your file (i.e. have you copied it to the posted message properly) ? -- Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTML errors
On Wednesday, January 12, 2011 04:14:42 am Pete Ford wrote: On 12/01/11 03:35, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters …omehome/a/lilia href=index.php?page=servicesservices/a/lilia h… I have tried various combinatons and different doctypes. I'm beginning to wonder if this code is allowed at all. All the other replies are talking nonsense (especially Daniel ;) ! There's no reason why HTML with single-quoted attributes isn't valid, so in principle your expected output of a href='index.php?page=services'services/a should be OK. The real challenge is to understand why the code fragment you have presented is losing the single quotes: are you *sure* this is exactly what you have in your file (i.e. have you copied it to the posted message properly) ? Thanks Pete. Funny story. Ya'll better not laugh, especially you Denial, oops I mean Daniel ;-) Anyway, All of us would never have fixed this error. We could have added double quotes, single quotes and every combination even the worlds best programmer would use and it wouldn't have gotten us anywhere. Thats because if your working on the wrong file. :-) -- Blessings David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
On Tuesday, January 11, 2011 11:48:33 pm Daniel Brown wrote: On Tue, Jan 11, 2011 at 22:35, David McGlone da...@dmcentral.net wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters This is because you misspelled $categorys, where it should actually be $categories. Goes to show ya, even Deaf people aren't perfect spellers. Still like your little joke? ;-) -- Blessings David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
On Tue, 2011-01-11 at 23:38 -0800, Jim Lucas wrote: On 1/11/2011 7:35 PM, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; Try this instead echo 'lia href=index.php?page=',$category,'',$replace,'/a/li'; Jim Lucas [snip] Jim, Not to be a smart ass like Danial was (which was brilliantly written though), but you have your example formatted incorrectly. You are using commas instead of periods for concatenation, and it would have thrown an error trying to run your example. :) # corrected: echo lia href=\index.php?page={$category}\{$replace}/a/li; Steve Staples. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
On 12 January 2011 13:20, Steve Staples sstap...@mnsi.net wrote: Jim, Not to be a smart ass like Danial was (which was brilliantly written though), but you have your example formatted incorrectly. You are using commas instead of periods for concatenation, and it would have thrown an error trying to run your example. :) # corrected: echo lia href=\index.php?page={$category}\{$replace}/a/li; Steve Staples. Steve, The commas are not concatenation. They are separators for the echo construct. I don't know the internals well enough, but ... echo $a.$b.$c; vs echo $a, $b, $c; On the surface, the first instance has to create a temporary variable holding the results of the concatenation before passing it to the echo construct. In the second one, the string representations of each variable are added to the output buffer in order with no need to create a temp var first. So, I think for large strings, using commas should be more efficient. Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
On Wed, Jan 12, 2011 at 06:38, David McGlone da...@dmcentral.net wrote: Goes to show ya, even Deaf people aren't perfect spellers. Still like your little joke? ;-) Of course I do. Deafness has nothing to do with spelling. If it did, just imagine how ridiculously difficult it would've been to decipher anything Helen Keller ever wrote. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
On Wed, Jan 12, 2011 at 12:08, David Harkness davi...@highgearmedia.com wrote: I tried this with PHP 5.3.2 on Ubuntu 10.04, but when I run any PHP script I get the following. Fatal error in php.ini line 184: Saying a thing doesn't make it so. What does this mean? Looks like you may have installed the PECL extension PHP_BSDetect. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
At 10:35 PM -0500 1/11/11, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters omehome/a/lilia href=index.php?page=servicesservices/a/lilia h I have tried various combinatons and different doctypes. I'm beginning to wonder if this code is allowed at all. -- Blessings David M. David: First of all, the type (strict or transitional) of DOCTYPE doesn't matter -- it only matters IF you are going to use deprecated HTML elements (transitional) or not (strict). Second, your li (i.e., list) should start with a type of list tag, such ol for ordered list -- there are several different types (i.e., ol, ul, dir, menu, dl dt dd). Third, you might try this: echo(lia href=\index.php?page=$category\$replace/a/li); The Validator might be objecting to the way you use ' instead of . HTH's Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Symbol Suggestion
I'd like to make a suggestion for a change, or possibly an addition, to the PHP language. I'm learning PHP and have been very excited with what it can do in relation to HTML. But when I got to the part about arrays, I was disappointed to see that they are designated with a $ the same as other variables. I was learning Perl before I switched, and it uses the @ sign to designate an array. That makes it a lot simpler to see at a glance what is an array and what isn't - at least for beginners like me. Has there been any talk of adopting the @ sign for arrays in PHP? Or is that symbol used for something else that I haven't read about yet? What is the proper channel for making suggestions like this? Thanks, Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
sono...@fannullone.us wrote: I'd like to make a suggestion for a change, or possibly an addition, to the PHP language. I'm learning PHP and have been very excited with what it can do in relation to HTML. But when I got to the part about arrays, I was disappointed to see that they are designated with a $ the same as other variables. I was learning Perl before I switched, and it uses the @ sign to designate an array. That makes it a lot simpler to see at a glance what is an array and what isn't - at least for beginners like me. Has there been any talk of adopting the @ sign for arrays in PHP? Or is that symbol used for something else that I haven't read about yet? What is the proper channel for making suggestions like this? The php-development mailing list. What you're suggesting is a pretty fundamental change, don't be disappointed if it is not met with universal approval. -- Per Jessen, Zürich (5.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
sono...@fannullone.us wrote: I'd like to make a suggestion for a change, or possibly an addition, to the PHP language. I'm learning PHP and have been very excited with what it can do in relation to HTML. But when I got to the part about arrays, I was disappointed to see that they are designated with a $ the same as other variables. I was learning Perl before I switched, and it uses the @ sign to designate an array. That makes it a lot simpler to see at a glance what is an array and what isn't - at least for beginners like me. Has there been any talk of adopting the @ sign for arrays in PHP? Or is that symbol used for something else that I haven't read about yet? What is the proper channel for making suggestions like this? Thanks, Marc Hi Marc, I'm a PHP n00b as well and had similar thoughts regarding this.. just imagine two variables called the same thing.. a string and array.. and accidentally resetting one.. $oops = something; however, from my experience, there is often this kind of problem in any language, and that is where naming conventions come in very handy. I don't know if the PHP community has any standard convention.. but I would suggest something like: $a_foo (for arrays) $f_foo (imploding into form variables) $s_foo (string variables) $db_foo (variables coming from databases perhaps) etc.. This way, you'd never be confused of the origin of the variable. Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
On Wed, 2011-01-12 at 11:45 -0800, sono...@fannullone.us wrote: I'd like to make a suggestion for a change, or possibly an addition, to the PHP language. I'm learning PHP and have been very excited with what it can do in relation to HTML. But when I got to the part about arrays, I was disappointed to see that they are designated with a $ the same as other variables. I was learning Perl before I switched, and it uses the @ sign to designate an array. That makes it a lot simpler to see at a glance what is an array and what isn't - at least for beginners like me. Has there been any talk of adopting the @ sign for arrays in PHP? Or is that symbol used for something else that I haven't read about yet? What is the proper channel for making suggestions like this? Thanks, Marc PHP is a loosely typed language, so you can have a variable that, throughout its lifetime in an app, is both a scaler (integer, string, etc) or an array. For example: ?php $message = hello world; echo $message; $message = array('hello', 'bob'); echo {$message[0]} {$message[1]}; ? There are functions you can use to determine the type of a variable, such as is_string() and is_array() and you can use var_dump() in debug statements to quickly see the type of a variable. I think changing something as integral as a variable prefix would break a lot of code which makes use of the loose typing, and would cause much more confusion further down the line. Also, as you may have guessed, the @ symbol is already in use at the moment. In PHP it ensures that minor errors are silently ignored. For example: @executeSomeFunction() would run that named function, but ignore any minor errors and warnings. You'll typically find it used a lot in calls to mail() as that can be flaky on some systems due to a number of factors outside of PHP. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Array Symbol Suggestion
On Jan 12, 2011, at 3:28 PM, Ashley Sheridan wrote: If you check out the manual pages for those functions as well, you'll see other related functions. I must say, of any language I've used, the php.net documentation is by far the best, giving plenty of information and user comments too. It's a resource I still can't do without, and I reckon even the old hands on this list would say the same. Thanks, Ash http://www.ashleysheridan.co.uk I fully agree with you on php.net being some of the best documentation out there. I would say that a lot of the Java documentation is wonderfully done as well. It doesn't offer user comments, but it is very complete and covers just about every aspect of a class. Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
On Wed, Jan 12, 2011 at 14:45, sono...@fannullone.us wrote: I'd like to make a suggestion for a change, or possibly an addition, to the PHP language. I'm learning PHP and have been very excited with what it can do in relation to HTML. But when I got to the part about arrays, I was disappointed to see that they are designated with a $ the same as other variables. I was learning Perl before I switched, and it uses the @ sign to designate an array. That makes it a lot simpler to see at a glance what is an array and what isn't - at least for beginners like me. Has there been any talk of adopting the @ sign for arrays in PHP? Or is that symbol used for something else that I haven't read about yet? The @ is an error control operator, used to buffer the output and store it in a variable - $php_errormsg. There's no way that would be changed to become an array designator (though that doesn't mean your idea itself is a bad one). What is the proper channel for making suggestions like this? Usually on the Internals mailing list (intern...@lists.php.net) or as a Feature Request in the bug tracker (http://bugs.php.net/). -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
On Wed, Jan 12, 2011 at 12:37 PM, Daniel Brown danbr...@php.net wrote: The @ is an error control operator, used to buffer the output and store it in a variable - $php_errormsg. There's no way that would be changed to become an array designator (though that doesn't mean your idea itself is a bad one). @ squelches error messages. AFAIK $php_errormsg is the last error that PHP incurred. not based on @ @ just silences the errors from being reported, which is a bad thing as error collection is done even if error_reporting is off, it is still built internally as a string, that's why developing with E_ALL and E_STRICT even on is the best practice. even notices wind up adding to the internal error/etc. string stack. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
On Wed, Jan 12, 2011 at 15:41, Michael Shadle mike...@gmail.com wrote: On Wed, Jan 12, 2011 at 12:37 PM, Daniel Brown danbr...@php.net wrote: The @ is an error control operator, used to buffer the output and store it in a variable - $php_errormsg. There's no way that would be changed to become an array designator (though that doesn't mean your idea itself is a bad one). @ squelches error messages. AFAIK $php_errormsg is the last error that PHP incurred. not based on @ Correct. The way I worded it makes it sound like @ is what populates the variable, which would be incorrect. Plus, I should also mention that $php_errormsg is only available if you enable track_errors anyway, which (if I remember correctly) is off by default. Thanks for pointing that out, Mike. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML errors
If you are going to use double quotes escape out. echo lia href='index.php?page=.$category.'.$replace./a/li; On Jan 12, 2011, at 2:30 PM, tedd tedd.sperl...@gmail.com wrote: At 10:35 PM -0500 1/11/11, David McGlone wrote: Hi Everyone, I'm having a problem validating some links I have in a foreach. Here is my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; my PHP code: $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials'); foreach($categorys as $category){ $replace = str_replace(_, , $category); echo lia href='index.php?page=$category'$replace/a/li; } Validator Error: an attribute value must be a literal unless it contains only name characters Šomehome/a/lilia href=index.php?page=servicesservices/a/lilia hŠ I have tried various combinatons and different doctypes. I'm beginning to wonder if this code is allowed at all. -- Blessings David M. David: First of all, the type (strict or transitional) of DOCTYPE doesn't matter -- it only matters IF you are going to use deprecated HTML elements (transitional) or not (strict). Second, your li (i.e., list) should start with a type of list tag, such ol for ordered list -- there are several different types (i.e., ol, ul, dir, menu, dl dt dd). Third, you might try this: echo(lia href=\index.php?page=$category\$replace/a/li); The Validator might be objecting to the way you use ' instead of . HTH's Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] projectpier
Heads up: jeg har flyttet projectpier over paa fastaval.dk domaenet - det koerer nu under pp.fastaval.dk. Der er ogsaa sat redirects op paa fastaval.plphp.dk saa man skulle ikke kunne komme til det gamle site (og dermed ikke logge ind det forkerte sted). -- hype WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] projectpier
On Wed, 2011-01-12 at 23:14 +0100, Peter Lind wrote: jeg har flyttet projectpier over paa fastaval.dk domaenet - det koerer nu under pp.fastaval.dk. Der er ogsaa sat redirects op paa fastaval.plphp.dk saa man skulle ikke kunne komme til det gamle site (og dermed ikke logge ind det forkerte sted) I think perhaps your change in domains was not meant to be posted to the list? :p Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] projectpier
2011/1/12 Ashley Sheridan a...@ashleysheridan.co.uk On Wed, 2011-01-12 at 23:14 +0100, Peter Lind wrote: jeg har flyttet projectpier over paa fastaval.dk domaenet - det koerer nu under pp.fastaval.dk. Der er ogsaa sat redirects op paa fastaval.plphp.dk saa man skulle ikke kunne komme til det gamle site (og dermed ikke logge ind det forkerte sted) I think perhaps your change in domains was not meant to be posted to the list? :p There's a massive ooops! if ever I did see one. Sorry about the (unintended) noise and thanks for letting me know.
Re: [PHP] projectpier
At least now we all know of the domainname change xD Sent from my iPhone On 12-01-2011, at 19:38, Peter Lind peter.e.l...@gmail.com wrote: 2011/1/12 Ashley Sheridan a...@ashleysheridan.co.uk On Wed, 2011-01-12 at 23:14 +0100, Peter Lind wrote: jeg har flyttet projectpier over paa fastaval.dk domaenet - det koerer nu under pp.fastaval.dk. Der er ogsaa sat redirects op paa fastaval.plphp.dk saa man skulle ikke kunne komme til det gamle site (og dermed ikke logge ind det forkerte sted) I think perhaps your change in domains was not meant to be posted to the list? :p There's a massive ooops! if ever I did see one. Sorry about the (unintended) noise and thanks for letting me know. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Closure and $this
Hello, Does anyone know if closures will ever support the $this keyword? I think it would be very useful when working with objects. Best regards__RaymondDo more with less - http://raxanpdi.com
Re: [PHP] Closure and $this
On Wed, 12 Jan 2011 20:02:11 -0800 (PST) Raymond Irving xwis...@yahoo.com wrote: Hello, Does anyone know if closures will ever support the $this keyword? I think it would be very useful when working with objects. Best regards__RaymondDo more with less - http://raxanpdi.com Probably not, and my understanding of why comes from this line from the docs (http://www.php.net/manual/en/functions.anonymous.php): Anonymous functions are currently implemented using the Closure class. So, in other words, your closure does not belong to the class you declare it in, but the Closure class. Thus, if it supported the $this variable, it would refer not to the class you want, but instead to the Closure class. Just my understanding. If it's not right, someone point it out. -- Greg Bair PHP Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Closure and $this
On Wednesday, January 12, 2011 11:37:19 pm Greg Bair wrote: On Wed, 12 Jan 2011 20:02:11 -0800 (PST) Raymond Irving xwis...@yahoo.com wrote: Hello, Does anyone know if closures will ever support the $this keyword? I think it would be very useful when working with objects. Best regards__RaymondDo more with less - http://raxanpdi.com Probably not, and my understanding of why comes from this line from the docs (http://www.php.net/manual/en/functions.anonymous.php): Anonymous functions are currently implemented using the Closure class. So, in other words, your closure does not belong to the class you declare it in, but the Closure class. Thus, if it supported the $this variable, it would refer not to the class you want, but instead to the Closure class. Just my understanding. If it's not right, someone point it out. Actually at one point early on they did support a $this, but the way it was bound to an object was half-assed and incomplete so it was removed entirely from 5.3. The intent was to then properly think through how that binding should happen and re-introduce it properly in 5.4. I believe a consensus was reached on how that should happen but I'm not sure what its implementation status is at present. I believe this is the relevant RFC: http://wiki.php.net/rfc/closures/object-extension --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
Ashley Sheridan wrote: On Wed, 2011-01-12 at 12:23 -0800, sono...@fannullone.us wrote: Thanks for all the responses to my suggestion. I realize this would be a major change, so that's why I also mentioned it as an addition to the language. I'm sure it's just what you're used to, but still being new to all this, it just makes sense (to me anyway) to have different symbols for different variable types: $scalar @array #hash Since the @ sign is already reserved, maybe there's another symbol that would work better? I don't know. These are just ideas that I came up with while reading and I thought I'd throw it out there to see what others thought. I like the idea of a naming convention, so that's what I'll do in my scripts. I also appreciate the heads up on is_string(), is_array(), and var_dump(). Thanks again, Marc If you check out the manual pages for those functions as well, you'll see other related functions. I must say, of any language I've used, the php.net documentation is by far the best, giving plenty of information and user comments too. It's a resource I still can't do without, and I reckon even the old hands on this list would say the same. Yes, I wouldn't want to be without my local php.net mirror. Other languages that can easily match the quality of the documentation - assembler, C and C++, to name a few. -- Per Jessen, Zürich (7.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Symbol Suggestion
Donovan Brooke wrote: however, from my experience, there is often this kind of problem in any language, and that is where naming conventions come in very handy. I don't know if the PHP community has any standard convention.. One popular naming convention: http://en.wikipedia.org/wiki/Hungarian_notation -- Per Jessen, Zürich (7.8°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php