Re: [PHP] why should $_SESSION be slower than other arrays?
In any case, it would appear the comments in the session section of the online docs are wrong or just out of date, and I don't need to worry about it. I'll go ahead and add a comment to that effect on the ref.session page. l8r Aaron --- Marek Kilimajer [EMAIL PROTECTED] wrote: Chris Dowell wrote: Entirely off the top of my head, I would imagine it has to do with the scope of the variables in question. When assigning a value to a variable, there must be some time spent resolving the scope in which that variable is valid, to see if the new value overwrites any existing value and to ensure that it is accessible from the correct places. As a superglobal, however, $_SESSION has a very specific and unchanging scope. If I were Zeev or Andi, I'd have added a little optimisation into ZE to check for trivial cases such as this and shortcut the tedious scoping. I could be wrong, but this seems to be the most obvious explanation. Has anyone tried this with any other superglobals like $_POST or $_SERVER? Just tried it, $_SESSION is certainly faster then $_POST, $_GET and $_SERVER: Session var: 0.380021095276 GET var: 0.50522685051 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why should $_SESSION be slower than other arrays?
I read in the docs several comments that $_SESSION is slower that other arrays. One comment even had benchmarking info indicating it was about half as fast. I don't understand why this should be. Isn't $_SESSION just a normal super global array like any other, except that it get serialized and written to disk *once at the end* of a request? Why on earth would this impact the performance of reading and writing in the middle of a request? Is there some funkyness going on under the covers that I'm missing? Can it be made to work as I described? l8r Aaron __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined index:
Hi, I'm learning php from a book but because of global off I have have several Undefined index message! I don't want to change the default setting in my php.ini because I want to learn the good way. What I'm doing wrong? Undefined index: categorie if ($_POST['categorie'] == New) { Undefined index: categorie $query = SELECT DISTINCT animalName FROM animal WHERE animalType='{$_REQUEST['categorie']}' ORDER BY animalName; Undefined index: categorie echo hrbNo name in {$_POST['categorie']}/bhr\n; Undefined index: categorie echo input type='hidden' name='categorie' value='$categorie'\n; Regards! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined constant error
Hello, I'm learning PHP from a book PHP for newbie writen in French and I have an error on one of the exemple. Undifined constant 'compteur' on line 15 which is : if (compteur == 1) { What I'm doing wrong? This is the script ?php include(config.inc.php); $query = SELECT * FROM Type ORDER BY animalType; $result = mysql_query($query) or die (Exécution de la sélection impossible); echo h1 align='center'Catalogue/h1ph3Quel type d'animal cherchez-vous ?/h3\n; echo form action='montre_animaux.php' method='post'\n; echo table cellpadding='5' border='1'; $compteur = 1; while ($ligne = mysql_fetch_array($result)) { extract($ligne); echo trtd valign='top' width='15%'; echo input type='radio' name='interet' value='$animalType'; if (compteur == 1) { echo checked; } echo font size='+1'b$animalType/b/font/tdtd$typeDescription/td/tr; $compteur++; } echo /table; echo pinput type='submit' name='submit' value='Faites votre choix'/form; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Thanks
Thank you Sascha and Matt you got it ! Everything is working fine now. There is a lot of printing error in this book :( Regards! Voisine Voisine wrote: Hello, I'm learning PHP from a book PHP for newbie writen in French and I have an error on one of the exemple. Undifined constant 'compteur' on line 15 which is : if (compteur == 1) { What I'm doing wrong? This is the script ?php include(config.inc.php); $query = SELECT * FROM Type ORDER BY animalType; $result = mysql_query($query) or die (Exécution de la sélection impossible); echo h1 align='center'Catalogue/h1ph3Quel type d'animal cherchez-vous ?/h3\n; echo form action='montre_animaux.php' method='post'\n; echo table cellpadding='5' border='1'; $compteur = 1; while ($ligne = mysql_fetch_array($result)) { extract($ligne); echo trtd valign='top' width='15%'; echo input type='radio' name='interet' value='$animalType'; if (compteur == 1) { echo checked; } echo font size='+1'b$animalType/b/font/tdtd$typeDescription/td/tr; $compteur++; } echo /table; echo pinput type='submit' name='submit' value='Faites votre choix'/form; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: unexpected T_SL
Your lucky :) because I'm using the same version and I have this parse error. Erwin wrote: Voisine wrote: Hi, What is wrong witht his code? Parse error: parse error, unexpected T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2 ?php $str = EOD Example of string spanning multiple lines using heredoc syntax. EOD; ? To be honest, there is nothing wrong. It works in version 4.2.2 (at least, here it does) ;-)) Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: unexpected T_SL
I tried everything and I still have this error. I have this error with php 4.2.2 on Windows 98 I also have the same problem with Apache, RedHat php 4.2.1. WellI'm going to skip this lesson. Thanks for all the help! Regards! Steel wrote: Hi Erwin, Monday, September 2, 2002, 11:28:09 AM, I've got: E Voisine wrote: Hi, What is wrong witht his code? Parse error: parse error, unexpected T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2 ?php $str = EOD Example of string spanning multiple lines using heredoc syntax. EOD; ? E To be honest, there is nothing wrong. It works in version 4.2.2 (at least, E here it does) ;-)) E Grtz Erwin Why not to try ?php $str = EOT ??? It seems to me, that EOD - End Of Data, and EOT - End Of Text Silly, but why not to try? :) -- The Same, Steelmailto:[EMAIL PROTECTED] http://www.none.ru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unexpected T_SL
Hi, What is wrong witht his code? Parse error: parse error, unexpected T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2 ?php $str = EOD Example of string spanning multiple lines using heredoc syntax. EOD; ? Regards! Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unexpected T_SL
I know how to use echo and print but I'm learning php so I try to understand why I have this error with the heredoc syntax. Thanks! Peter Houchin wrote: simple .. look up docs on putting straight text to the screen and u'll find a number of options such as echo and print i bet ya'd be able to solve really quickly -Original Message- From: Voisine [mailto:[EMAIL PROTECTED]] Sent: Monday, 2 September 2002 12:34 PM To: [EMAIL PROTECTED] Subject: [PHP] unexpected T_SL Hi, What is wrong witht his code? Parse error: parse error, unexpected T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2 ?php $str = EOD Example of string spanning multiple lines using heredoc syntax. EOD; ? Regards! Joe -- 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