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
rs - id (PK) - name - etc And we're using a Session to store references (not actual PHP references ofcourse just the identifying integers) to these tables. For example a list of companies and locations which are selected in the GUI is kept in the session state. The session would look som

[PHP] References in Sessions

2010-10-11 Thread Alexander Schrijver
we're using a Session to store references (not actual PHP references ofcourse just the identifying integers) to these tables. For example a list of companies and locations which are selected in the GUI is kept in the session state. The session would look something like this when filled up.

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

[PHP] References to a variable and scope

2007-12-04 Thread Cesar D. Rodas
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 content when I need, similar to PDO "bindParam". I will try to explain b

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); >

[PHP] References challenge with PHP4

2007-03-16 Thread Lluis Pamies
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 static $inst; 20 if(!isset($inst)) $inst = new A()

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

[PHP] references for beginner...

2006-06-14 Thread BBC
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 about all the syntax, and what for are they

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 <[EM

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

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

2005-12-06 Thread Alan Pinstein
So.. I am having PHP5 memory management problems. They are similar to those described in this thread: http://aspn.activestate.com/ASPN/Mail/Message/php-Dev/1555640 (so maybe this question belongs on php-dev but I figured I'd try here first... seems like a userland question) Basically I have

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

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

2004-09-19 Thread Gerard Samuel
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 $GLOBALS array in me

[PHP] References and array indexes

2004-08-05 Thread Gabriel Birke
Hello! The following PHP code: "First Element", "2"=>"Second Element"); $v = &$a['3']; print_r($a); ?> has this result: Array( 1 => First Element, 2 => Second Element, 3 => ) Can anyone give me an explanation for this? What is happening in the guts of the PHP interpreter wh

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

[PHP] references

2004-05-13 Thread Vladislav Shulgin
Hi! I found that when I try to call class method "addchild" from reference of object - php change not original object. New copy of object will created. Very strange Example: absnum = $absnum; } function addchild(&$node) { if (!is_array($this->childs)) $this->childs = array(); $this-

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

[PHP] References and memory efficiency

2003-11-01 Thread Joachim Krebs
Hi there, 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 iterate thr

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

[PHP] references

2003-07-22 Thread Carl Furst
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 passing in function b legal??? Carl Furst Chief Technical Officer Vote.com 50 Wa

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 > >

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

[PHP] references a functions

2002-04-04 Thread javier
I trying to code a kind of DB wrapper. So when is dbQuery turn I run into trouble. I read in php manual that refrences are not like C pointers. They just point to the same content. I want to return the result from a mysql_query but if I do something like this: function bdConsultar($strCon)

RE: [PHP] - References Clarification Please -

2001-12-09 Thread Jason Lotito
Site(&$dbObj) { $this->db =& $dbObj; } Like that. Jason Lotito [EMAIL PROTECTED] www.NewbieNetwork.net > -Original Message- > From: Matt Friedman [mailto:[EMAIL PROTECTED]] > Sent: Sunday, December 09, 2001 1:34 PM > To: [EMAIL PROTECTED] > Subject: [PHP] - Refere

[PHP] - References Clarification Please -

2001-12-09 Thread Matt Friedman
Hi, I'm just trying to get my head around references and the uses etc... I have reviewed the manual section on this a few times but I'm still a bit fuzzy on it. First of all, here's some code I'm using to pass a reference to an object (which has global scope) to the constructor of a class "Site"

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

[PHP] References: & in front of functionnames

2001-08-03 Thread Rolf Rensaa
Hello. I've read a book, PHP DEVELOPER'S COOKBOOK, with great interest and it's a great contribution to my bookcollection :-) There is something I would like to know thoughI have searched through all my books and sites on PHP, but didn't find the answer In chapter 16 (Creating a Database

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

[PHP] references... found it

2001-07-31 Thread scott [gts]
im sorry, but i was trying to do that the hard way. i figured out how to execute a function name in a variable. $x ="test"; print "Hello: $x\n\n"; $x(); function test() { print "yee haw"; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] F

[PHP] references

2001-07-31 Thread scott [gts]
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. what i'd like to do is something like this: // X is no

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;

[PHP] References & Object XML-Parser

2001-05-16 Thread Mirek Novak
Hi, I'm new to this list, and was forced to join because of following problem, BTW searching through the archive ended without any useable results. The problem is in following code - which is little extended source from example in manual entry for xml_set_object() function. I've added one member

[PHP] References

2001-05-12 Thread Steve
Hello all, My apologies if this is has been answered before or if this is considered beginner material...but I am trying to make something of a linked list using PHP. However, with the absence of pointers, I'm wondering if references will do the trick. For example:

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

[PHP] References in an array

2001-01-19 Thread Ruppel, Mathias
Hi there, I'm just a beginner in programming PHP; so my problem is probably a mistake in my thinking. I'm using some arrays to display information of an internal news-server in a web-browser, like $overview = imap_fetch_overview($mbox, "1:$last", 0); $IDs = array(); $i = 0; foreach($overview