Re: [PHP] References in Sessions

2010-10-14 Thread Alexander Schrijver
On Thu, Oct 14, 2010 at 05:36:29PM +0200, Sebastian Detert wrote: > Alexander Schrijver schrieb: > >Is my message unclear? or didn't anyone ran into this problem? > > > If you want an atomic solution, you need to save the session to your > database. How often do you need to delete data? Isn't it b

Re: [PHP] References in Sessions

2010-10-14 Thread Sebastian Detert
Alexander Schrijver schrieb: Is my message unclear? or didn't anyone ran into this problem? If you want an atomic solution, you need to save the session to your database. How often do you need to delete data? Isn't it better to delete at night when noone is online, or logout all users for

Re: [PHP] References in Sessions

2010-10-14 Thread Alexander Schrijver
Is my message unclear? or didn't anyone ran into this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] References in Sessions

2010-10-11 Thread Alexander Schrijver
On Mon, Oct 11, 2010 at 04:43:06PM +0200, Sebastian Detert wrote: > Why don't you write a small function checking for invalid IDs and > delete them and referenced subIDs? If you guess it's to hard/slow to > find out all referenced subIDs you could change your Session array > to an multi-dimensional

Re: [PHP] References in Sessions

2010-10-11 Thread Sebastian Detert
Alexander Schrijver schrieb: Hi list, I'm working on a project which uses a MySQL database to store some data. The database looks something like this: Companies - id (PK) - name - sector_id -> Sectors (id) - etc Locations - id (PK) - company_id -> Companies (id) - name - etc Sectors - id (PK)

Re: [PHP] References to a variable and scope

2007-12-06 Thread Richard Lynch
On Tue, December 4, 2007 2:58 pm, Cesar D. Rodas wrote: > I know that PHP doesn't support pointers to a variable, instead of > that > there is references to a variable which are similar to pointers, > right? > > BTW, what I want to do is to save a references to a variable and read > the > content w

Re: [PHP] References to a variable and scope

2007-12-04 Thread Cesar D. Rodas
On 04/12/2007, Cesar D. Rodas <[EMAIL PROTECTED]> wrote: > > Robert, > > On 04/12/2007, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > On Tue, 2007-12-04 at 16:58 -0400, Cesar D. Rodas wrote: > > > Hello, > > > > > > I know that PHP doesn't support pointers to a variable, instead of > > that >

Re: [PHP] References to a variable and scope

2007-12-04 Thread Robert Cummings
On Tue, 2007-12-04 at 16:58 -0400, Cesar D. Rodas wrote: > Hello, > > I know that PHP doesn't support pointers to a variable, instead of that > there is references to a variable which are similar to pointers, right? > > BTW, what I want to do is to save a references to a variable and read the > c

Re: [PHP] References challenge with PHP4

2007-03-25 Thread Martin Alterisio
2007/3/23, Jochem Maas <[EMAIL PROTECTED]>: Martin Alterisio wrote: > 2007/3/20, Jochem Maas <[EMAIL PROTECTED] >: > > Robert Cummings wrote: > > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: > >> ok, I tried it in a whole number of variations - > >> no joy. > >> >

Re: [PHP] References challenge with PHP4

2007-03-23 Thread Jochem Maas
Martin Alterisio wrote: > 2007/3/20, Jochem Maas <[EMAIL PROTECTED] >: > > Robert Cummings wrote: > > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: > >> ok, I tried it in a whole number of variations - > >> no joy. > >> > >> you should use

Re: [PHP] References challenge with PHP4

2007-03-21 Thread Robert Cummings
On Wed, 2007-03-21 at 18:09 -0300, Martin Alterisio wrote: > > Actually, is not a bug, is expected behaviour and documented in the manual > > http://php.net/static > > See the last section, named "references with global and static variables" > > static and global are implemented internally as re

Re: [PHP] References challenge with PHP4

2007-03-21 Thread Martin Alterisio
2007/3/20, Jochem Maas <[EMAIL PROTECTED]>: Robert Cummings wrote: > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: >> ok, I tried it in a whole number of variations - >> no joy. >> >> you should use php5 if you want this kind of reference >> stuff - in php5 it just works, php 4 will give

Re: [PHP] References challenge with PHP4

2007-03-20 Thread Jochem Maas
Robert Cummings wrote: > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: >> ok, I tried it in a whole number of variations - >> no joy. >> >> you should use php5 if you want this kind of reference >> stuff - in php5 it just works, php 4 will give you big headaches. > > Now now, don't be call

Re: [PHP] References challenge with PHP4

2007-03-20 Thread Robert Cummings
On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: > ok, I tried it in a whole number of variations - > no joy. > > you should use php5 if you want this kind of reference > stuff - in php5 it just works, php 4 will give you big headaches. Now now, don't be calling PHP5 "ALL THAT" when it can't

Re: [PHP] References challenge with PHP4

2007-03-20 Thread Jochem Maas
ok, I tried it in a whole number of variations - no joy. you should use php5 if you want this kind of reference stuff - in php5 it just works, php 4 will give you big headaches. Lluis Pamies wrote: > En/na Jochem Maas ha escrit: >> Lluis Pamies wrote: >>> I've the following code: >>> >>> 1 >> 2

Re: [PHP] References challenge with PHP4

2007-03-19 Thread Lluis Pamies
En/na Jochem Maas ha escrit: Lluis Pamies wrote: I've the following code: 1 a = &$a; 6 } 7 8 function run() { 9 print "{$this->a->msg}\n"; 10 } 11 } 12 13 class A { 14 function A() { 15 $this->b = new B(&$this); 16 } 17 18 function &getInstance() { 19 stat

Re: [PHP] References challenge with PHP4

2007-03-16 Thread Jochem Maas
Lluis Pamies wrote: > I've the following code: > > 1 2 > 3 class B { > 4 function B(&$a) { > 5 $this->a = &$a; > 6 } > 7 > 8 function run() { > 9 print "{$this->a->msg}\n"; > 10 } > 11 } > 12 > 13 class A { > 14 function A() { > 15 $this->b = new B(&$this); >

RE: [PHP] references for beginner...

2006-06-14 Thread Jay Blanchard
[snip] I just joined this forum [/snip] Some must read info; http://zirzow.dyndns.org/php-general/NEWBIE http://www.php.net/manual/en/security.php http://phpsec.org/ http://www.hardened-php.net/advisories.15.html http://phpsec.org/projects/guide/ -- PHP General Mailing List (http://www.php.n

Re: [PHP] references for beginner...

2006-06-14 Thread BBC
Thank Mr.Figaro. - Original Message - From: "nicolas figaro" <[EMAIL PROTECTED]> To: Sent: Wednesday, June 14, 2006 5:21 AM Subject: Re: [PHP] references for beginner... BBC a écrit : Hii all I just joined this forum, I'm beginner of PHP programmin

Re: [PHP] references for beginner...

2006-06-14 Thread tedd
At 5:16 AM -0700 6/14/06, BBC wrote: >Hii all >I just joined this forum, I'm beginner of PHP programming. >I didn't understand almost all the syntax you're talking about (ups too >honest, right?), so please... >Does anyone have a kinds of references like soft books or something, which >talk a

Re: [PHP] references for beginner...

2006-06-14 Thread nicolas figaro
BBC a écrit : Hii all I just joined this forum, I'm beginner of PHP programming. welcome. I didn't understand almost all the syntax you're talking about (ups too honest, right?), so please... Does anyone have a kinds of references like soft books or something, which talk about all the synt

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-08 Thread Alan Pinstein
/* comments inline */ On Dec 8, 2005, at 2:34 AM, Curt Zirzow wrote: On Wed, Dec 07, 2005 at 09:30:36PM -0500, Alan Pinstein wrote: On Dec 7, 2005, at 12:36 AM, Curt Zirzow wrote: I'm not sure how you mean a weak reference, and well a refcount is rather meaning less in php userland. So, t

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-07 Thread Curt Zirzow
On Wed, Dec 07, 2005 at 09:30:36PM -0500, Alan Pinstein wrote: > > On Dec 7, 2005, at 12:36 AM, Curt Zirzow wrote: > > > >I'm not sure how you mean a weak reference, and well a refcount is > >rather meaning less in php userland. > > So, this gets interesting. I don't know if you're familiar with

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-07 Thread Alan Pinstein
On Dec 7, 2005, at 12:36 AM, Curt Zirzow wrote: My original statement was to show how the the php4 = &$o is different. Oh, well, sure I believe that! :) In php5 variables are just containers that point to objects, so when you make a variable a reference to another variable all you are doi

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-07 Thread Alan Pinstein
Hey Ray- Thanks for the link! Actually, the article didn't help directly, but it did spark an idea. My main problem all along was trying to get a true reference to $this. For some reason reading the article led me to try "$this- >this", which works, to my surprise! So, I now have a complet

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-07 Thread Alan Pinstein
[ man.. I just realized that "reply" to this list doesn't send to the list... replies being re-sent... thanks for the help! ] On Dec 6, 2005, at 10:45 PM, Curt Zirzow wrote: I'm going to jump to the code as fast as possible to explain what I can, the key thing to remember in php5 is that the

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-06 Thread Anas Mughal
One example he presented is suited to pre-PHP5. With PHP5, a reference to self could be kept inside the class as a static member. No need to use a global variable. Just wanted to bring this up for new comers to PHP references and global variables. Cheers. On 12/6/05, Ray Hauge <[EMAIL PROTECT

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-06 Thread Curt Zirzow
On Tue, Dec 06, 2005 at 10:46:36PM -0500, Alan Pinstein wrote: > >the key thing to remember in php5 is that the old &$var > >declaration has no real meaning in objects. php5's objects exist > >outside of the old oop reference. Consider: > > Hmmm... I am not sure I believe this. > > I understand

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-06 Thread Curt Zirzow
I'm going to jump to the code as fast as possible to explain what I can, the key thing to remember in php5 is that the old &$var declaration has no real meaning in objects. php5's objects exist outside of the old oop reference. Consider: class Object { public $val; function __construct($v) {

Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-06 Thread Ray Hauge
I am uncertain on this, but I believe that the $this variable is already just a reference to the class you are calling it from. Then passing the reference by-reference to the addParent() method of the Child class could be what is causing your issue. I'd be curious to see what would happen if

Re: [PHP] References Explained... (This time Im stumped)

2004-09-19 Thread Gerard Samuel
Gerard Samuel wrote: I could have sworn that references and I used to get along... In the menu::hasChild method, I cant seem to reference $this->_data. $this->_data is supposed to be a reference to the original array $array in the local scope. The only way to make this script work is to call on the

Re: [PHP] references

2004-05-13 Thread Tom Rogers
Hi, Friday, May 14, 2004, 5:10:49 AM, you wrote: VS> Hi! VS> I found that when I try to call class method "addchild" from reference of VS> object - php change not original object. New copy of object will created. VS> Very strange VS> Example: VS> class pages { VS> var $childs; VS> var $a

RE: [PHP] References and memory efficiency

2003-11-03 Thread Johnson, Kirk
> I've been working on a database wrapper class for a while > now, MySQL to > be specific. Until now, I've simply had a fetch function > that returned > an array of all the rows that the database returned, only > because I have > gotten so tired of always writing the same while loop to > it

Re: [PHP] references

2003-07-22 Thread Curt Zirzow
* Thus wrote Carl Furst ([EMAIL PROTECTED]): > Ok lets see I have the following two functions one calls the other > > Function a (&$myref) { > > ..something... then calls function b > > b($myref); > > } > > function b (&$myref) { > > something > > } > > a($myref); > > is the reference by

Re: [PHP] references a functions

2002-04-04 Thread javier
Opossed to my thoughts worked fine. Rick Emery wrote: > What happened when you tried? > > -Original Message- > From: javier [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 04, 2002 1:01 PM > To: [EMAIL PROTECTED] > Subject: [PHP] references a functions > > > I trying to code a kind

Re: [PHP] references a functions

2002-04-04 Thread javier
I thought that apart from returning an id the result set was created within the scope of the function so when the function finishes the resulted was deleted; But since is just an id an the result is stored somewhere else I wouldn't need any reference. btw where can I read about references bes

Re: [PHP] references a functions

2002-04-04 Thread Rasmus Lerdorf
Note that you rarely change a result set, so there is very little point in returning a reference to it given PHP's shallow copy implementation. And in your case you are just returning a resource id which you definitely aren't going to change. But if for some reason you feel it is important (plea

RE: [PHP] references a functions

2002-04-04 Thread Rick Emery
What happened when you tried? -Original Message- From: javier [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 1:01 PM To: [EMAIL PROTECTED] Subject: [PHP] references a functions I trying to code a kind of DB wrapper. So when is dbQuery turn I run into trouble. I read in php ma

RE: [PHP] - References Clarification Please -

2001-12-09 Thread Jason Lotito
Actually, $this->db will be a copy of $dbObj. Here is what you have: db = $dbObj; } ?> What this means is that $dbObj is a reference to $db. However, $this->db is a copy. If you want $this->db to be a reference of $db, you have to create a reference to $dbObj. function Site(&$dbObj) { $thi

Re: [PHP] References: & in front of functionnames

2001-08-03 Thread Tim
The function return value is by reference. http://www.php.net/manual/en/language.references.php - Tim > Ex. in DB/standard.php; function &db_fetchall($args=array()){ ... > > I've seen and used the pass by reference syntax on function parameters but > not on functionnames. > What effect does re

Re: [PHP] references... found it

2001-07-31 Thread Philip Olson
Just for the sake of completing this thread, variable functions can be read about here : http://www.php.net/manual/en/functions.variable-functions.php Regards, Philip On Tue, 31 Jul 2001, scott [gts] wrote: > im sorry, but i was trying to do that the hard > way. i figured out how to execut

Re: [PHP] references

2001-07-31 Thread Alexander Wagner
scott [gts] wrote: > i've been reading over the docs on references, and i > can't see anyway to pass around functions as references. > i know how to do this easily with perl, but i cannot > seem to find the correct syntax for creating a reference > to a function in PHP. >[..] > any and all help is

Re: [PHP] References & Object XML-Parser

2001-05-16 Thread Peter Dudley
I am new to PHP's OO (though not to OO or to PHP), but here's a fix and my assessment of why it works: In your tag functions, you need to change the $this reference to instead refer to your $xml_parser object, thus: function tag_open($parser,$tag,$attributes) { global $xml_parser;

Re: [PHP] References in an array

2001-01-19 Thread Richard Lynch
> $overview = imap_fetch_overview($mbox, "1:$last", 0); > $IDs = array(); > $i = 0; > > foreach($overview as $val){ > $IDs[$i][0] = $val->message_id; > $IDs[$i][1] = &$val; > $i++; > } > > echo ""; > foreach($IDs as $val){ > echo "" . $val[1]->subject . ""; > } > echo ""; > > Unfor