Re: [PHP] Unset and __destruct

2012-12-07 Thread Sebastian Krebs
2012/12/6 Pierre du Plessis > Hi all > > I searched the internet (probably not hard enough), and couldn't find a > decent answer. > > I was wondering why, when calling unset on an object, it doesn't > automatically call the __destruct method (if it exists) on the object. > Thats because it was n

[PHP] Unset and __destruct

2012-12-06 Thread Pierre du Plessis
Hi all I searched the internet (probably not hard enough), and couldn't find a decent answer. I was wondering why, when calling unset on an object, it doesn't automatically call the __destruct method (if it exists) on the object. When unsetting an object, php doesn't automatically remove referen

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Lupus Michaelis
Ashley Sheridan wrote: That would seem sensible to me though really. A constructor only bears true for the base class, so any classes which inherit it must incorporate all the constructor parts. A destructor doesn't know about further classes which will need to inherit it, so it shouldn't be inh

[PHP] unset() something that doesn't exist

2009-08-24 Thread Tom Worster
is it the case that unset() does not trigger an error or throw an exception if it's argument was never set? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread hack988 hack988
i test your codes again,it is work correctly! But for backends compatibly with older php versions my codes is better :),i'm sorry for my mistake at moment. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
Stuart, u are right, the refcount in php 5 doesn't matter, where something left behind in my memory from earlier days, However i do have the effect that unsetting an object does NOT call __dectruct() ! but when the script ends it is called. this can be easily tested by putting a echo in destruct.

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
I dont agree, and as u see in my snipped code it works fine. in an abstract class u can define an implementation to define some basic things a overwriting function in an extending class has to take care of as well. this includes specialy magic functions. thats what they are made for. may be you

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread hack988 hack988
see http://cn.php.net/manual/en/language.oop5.abstract.php PHP 5 introduces abstract classes and methods. It is not allowed to create an instance of a class that has been defined as abstract. Any class that contains at least one abstract method must also be abstract. Methods defined as abstract sim

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Stuart
2009/8/24 Ralph Deffke : > this is also not the full truth try this and it works > what are the circumstances that is causing this problem then, yes I do have > distributed references over my script and there are clearly references still > set, however after running the snipped script I can not see

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
this is also not the full truth try this and it works what are the circumstances that is causing this problem then, yes I do have distributed references over my script and there are clearly references still set, however after running the snipped script I can not see what I do special in my script c

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Luke
2009/8/24 Ralph Deffke > typing error sorry > > forget my last post > > is there a was to destroy an object if there is hold a reference somewhere? > > "Stuart" wrote in message > news:a5f019de0908240606x5fdca70bkb31dd32b072e5...@mail.gmail.com... > > 2009/8/24 kranthi : > > > unset($obj) always

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
typing error sorry forget my last post is there a was to destroy an object if there is hold a reference somewhere? "Stuart" wrote in message news:a5f019de0908240606x5fdca70bkb31dd32b072e5...@mail.gmail.com... > 2009/8/24 kranthi : > > unset($obj) always calls the __destruct() function of the cl

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ashley Sheridan
On Mon, 2009-08-24 at 15:13 +0200, Ralph Deffke wrote: > that is correct and that is the problem, and even that is not all !!! > > try this > > > abstract class a { > public function __construct(){ > echo "constructing"; > } > public function __detruct(){ > echo "destructing..

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
that is correct and that is the problem, and even that is not all !!! try this "; } public function __detruct(){ echo "destructing"; } } class b extends a{ } $c = new b(); unset( $c ); ?> the constructor is inherited, the destructor not !! PHP 5.2.9-1 and PHP 5.3.0 behave the sam

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Lupus Michaelis
kranthi wrote: unset($obj) always calls the __destruct() function of the class. Never calls the dtor. The dtor will be called only when the reference count reaches 0. class c { function __destruct() { echo 'dying !' ; } } $v1 = new c ; $v2 = $v1 ; unset($v1) ; // don't call the dtor unset

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Stuart
2009/8/24 kranthi : > unset($obj) always calls the __destruct() function of the class. > > in your case clearly you are missing something else. Probably > unset($anobject) is not being called at all ? That's not entirely correct. PHP uses reference counting, so if unsetting a variable did not caus

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread kranthi
unset($obj) always calls the __destruct() function of the class. in your case clearly you are missing something else. Probably unset($anobject) is not being called at all ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
but it should? shouldn't it how can I destroy a class instance invocing __detruct() of the class ?!?!? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Bill
Why $_GET['i'] doesn't unsets ? Your page URL has ?i=asdf in it. As such, $_GET['i'] is being set every time you refresh that particular URL. Unsetting $_GET['i'] will only erase the variable for that instance of that PHP script. As soon as you refresh, you are calling a new instance of that

Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Dan Shirah
> > Dan Shirah a écrit : > >> How about just adding a simple counter on your page. >> >> > That's what I do but that "counter" resets when you press F5 and is not > functionnal. > > Why $_GET['i'] doesn't unsets ? Are you saving the array to a database once it is created? If not, wouldn't the a

Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Micah Gersten
The $_GET array comes from the URL which is resent every time someone hits F5. unset works on the server, not on the browser. You could capture it, add it to the session and then redirect without it in the URL. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com

RE: [PHP] unset($_GET['i'])

2008-09-04 Thread Boyd, Todd M.
> -Original Message- > From: Bill [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 04, 2008 3:23 PM > To: php-general@lists.php.net > Subject: Re: [PHP] unset($_GET['i']) > > Dan Shirah a écrit : > > How about just adding a simple counter on you

Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Wolf
Bill <[EMAIL PROTECTED]> wrote: > Dan Shirah a écrit : > > How about just adding a simple counter on your page. > > > > That's what I do but that "counter" resets when you press F5 and is not > functionnal. > > Why $_GET['i'] doesn't unsets ? Because you get a new i from the URL, hence

Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Bill
Dan Shirah a écrit : How about just adding a simple counter on your page. That's what I do but that "counter" resets when you press F5 and is not functionnal. Why $_GET['i'] doesn't unsets ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.p

Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Dan Shirah
> > Hi > > given page1 has a list of goods and sends $i as a variable into a link to > page2, ie, send > > Page2 adds the items recieved in an array. > > In page2 how can I unset the $_GET['i'] so that if I press F5(refresh) it > doesn't add the same item to the array ? > > I tried unset($_GET['i']

[PHP] unset($_GET['i'])

2008-09-04 Thread Bill
Hi given page1 has a list of goods and sends $i as a variable into a link to page2, ie, send Page2 adds the items recieved in an array. In page2 how can I unset the $_GET['i'] so that if I press F5(refresh) it doesn't add the same item to the array ? I tried unset($_GET['i']) but no succes

Re: [PHP] unset in foreach breaks recrusion

2008-07-01 Thread David Sky
Jim, Read the first emails, your idea was my initial design, eg. $sorted= array(); recrusion($array, &$sorted); var_dump( $sorted ); It's not a "nice" solution due to a need to create variable before the call. Using my final function it will return sorted array into new variable eg $sorted = recu

Re: [PHP] unset in foreach breaks recrusion

2008-07-01 Thread Jim Lucas
David Sky wrote: Hey, Can't use your example, as you check weather $sorted is empty, if it is -> run the foreach and return, but on next recursion when it's not empty - do nothing :) Though I found how to cut a few seconds (on very big array), removing the first if, and adding a $return=true to

Re: [PHP] unset in foreach breaks recrusion

2008-07-01 Thread Roberto Costumero Moreno
That's true. My fault. I forgot the recrusion call ;-) I think that is the better solution so far, and it is far far away (better) that the one you posted at first On 01/07/2008, David Sky <[EMAIL PROTECTED]> wrote: > > Hey, > > Can't use your example, as you check weather > $sorted is empty, if

Re: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread David Sky
Hey, Can't use your example, as you check weather $sorted is empty, if it is -> run the foreach and return, but on next recursion when it's not empty - do nothing :) Though I found how to cut a few seconds (on very big array), removing the first if, and adding a $return=true to functions' paramet

Re: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread Roberto Costumero Moreno
Hi David, That's good work ;-) You are right that my example would only return one entry for each parent. Didn't realized of that. I know the local copies you create in the recursive calls is not the best solution in efficiency, but lots of times it is better to have local copies of the array (i

Re: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread David Sky
Hey Robero, Thanks for the answer, the none recursion function is a good idea, although as provided in your example if would only return one entry from each parent it can get to and it only can get to few, depends on how the array is sorted. Basically you can make it work if you would sort the ar

Re: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread Roberto Costumero Moreno
That's not the problem. Look that the function is called with &$return, so there is a reference to the variable in which the function returns the value (if not there would not be an answer...). Otherwise, i think the problem is in the recursive call inside the function. Once you make the unset, yo

Re: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread Jason Norwood-Young
On Sun, 2008-06-29 at 18:25 -0800, David Sky wrote: > Hello everyone! > > A couple of days ago I submitted a bug to PHP > http://bugs.php.net/bug.php?id=45385 > But I was mistaken, apparently it's not a bug. > And I was "sent" here to get help. I think you might be forgetting to return $return.

RE: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread Chetan Rane
] Sent: Monday, June 30, 2008 12:09 PM To: php-general@lists.php.net Subject: Re: [PHP] unset in foreach breaks recrusion David Sky wrote: > Hello everyone! > > A couple of days ago I submitted a bug to PHP > http://bugs.php.net/bug.php?id=45385 > But I was mistaken, apparently

Re: [PHP] unset in foreach breaks recrusion

2008-06-29 Thread Per Jessen
David Sky wrote: > Hello everyone! > > A couple of days ago I submitted a bug to PHP > http://bugs.php.net/bug.php?id=45385 > But I was mistaken, apparently it's not a bug. > And I was "sent" here to get help. > [snip] > So before I write a reply to the bug i submitted, I wanted to know > if ther

[PHP] unset in foreach breaks recrusion

2008-06-29 Thread David Sky
Hello everyone! A couple of days ago I submitted a bug to PHP http://bugs.php.net/bug.php?id=45385 But I was mistaken, apparently it's not a bug. And I was "sent" here to get help. Although I did tried what was suggested in the response, Actually I tried it before I wrote about the bug, as I foun

Re: [PHP] unset and circular references

2008-06-27 Thread T Lensselink
Abu Warez wrote: > --- On Fri, 6/27/08, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > >> From: Thijs Lensselink <[EMAIL PROTECTED]> >> Subject: Re: [PHP] unset and circular references >> To: php-general@lists.php.net >> Date: Friday, June 27, 2008, 5:21

Re: [PHP] unset and circular references

2008-06-27 Thread Abu Warez
--- On Fri, 6/27/08, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > From: Thijs Lensselink <[EMAIL PROTECTED]> > Subject: Re: [PHP] unset and circular references > To: php-general@lists.php.net > Date: Friday, June 27, 2008, 5:21 PM > Quoting Abu Warez <[EMAIL PR

Re: [PHP] unset and circular references

2008-06-27 Thread Abu Warez
--- On Fri, 6/27/08, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > From: Thijs Lensselink <[EMAIL PROTECTED]> > Subject: Re: [PHP] unset and circular references > To: php-general@lists.php.net > Date: Friday, June 27, 2008, 5:21 PM > Quoting Abu Warez <

Re: [PHP] unset and circular references

2008-06-27 Thread Thijs Lensselink
Quoting Abu Warez <[EMAIL PROTECTED]>: Hi, I'm using php 5.2.1 on an Ubuntu machine. I have the following class diagram (observer pattern): +-+ +-+ +-+ | class A |<#>->| class B |< >->| interface C | | | +

[PHP] unset and circular references

2008-06-27 Thread Abu Warez
Hi, I'm using php 5.2.1 on an Ubuntu machine. I have the following class diagram (observer pattern): +-+ +-+ +-+ | class A |<#>->| class B |< >->| interface C | | | +-+ | | |

[PHP] unset thoughts

2008-05-20 Thread Nathan Rixham
what do we think of: while(1) { #script here to do stuff unset( array_keys(get_defined_vars()) ); sleep(10); } thoughts anybody, or a better way of keeping memory usage down on other peoples scripts that I don't have time to fumble about cleaning Regards Nath -- PHP General Mailing List

Re: [PHP] unset() side effects in functions

2007-04-23 Thread Robert Enyedi
Rob, Thanks for the detailed explanation about the reference assignments that are happening in the background. Now things start to make sense :-) Regards, Robert Robert Cummings wrote: On Mon, 2007-04-23 at 14:04 +0300, Robert Enyedi wrote: I'm doing some experimenting with the unset() (http

Re: [PHP] unset() side effects in functions

2007-04-23 Thread Auto-Deppe, C. Haensel
ssage - From: "Robert Cummings" <[EMAIL PROTECTED]> To: "Robert Enyedi" <[EMAIL PROTECTED]> Cc: Sent: Monday, April 23, 2007 3:05 PM Subject: Re: [PHP] unset() side effects in functions On Mon, 2007-04-23 at 14:04 +0300, Robert Enyedi wrote: I'm doing

Re: [PHP] unset() side effects in functions

2007-04-23 Thread Robert Cummings
On Mon, 2007-04-23 at 14:04 +0300, Robert Enyedi wrote: > I'm doing some experimenting with the unset() (http://php.net/unset) > language construct in a PHP 5.2.1 installation. I did not find any > documentation on what happens to an identically named local variable's > value after an unset is p

[PHP] unset() side effects in functions

2007-04-23 Thread Robert Enyedi
I'm doing some experimenting with the unset() (http://php.net/unset) language construct in a PHP 5.2.1 installation. I did not find any documentation on what happens to an identically named local variable's value after an unset is performed. Let me start with this example: in function (init):

[PHP] unset globals and memory_get_usage

2006-09-08 Thread Matthew North
Hello All, I've been struggling with a rather obscure PHP memory issue for the last few days. Here's my setup: FreeBSD 5.5 Apache2.0, PHP 5.1.6, and MySQL 4.1.x compiled from scratch (that is, we're not using FreeBSD ports) PHP is compiled with --enable-memory-limit and the limit is set to 8MB

Re: [PHP] unset a constant

2006-03-27 Thread Jasper Bryant-Greene
There is no way using the core language. You can, however, use the runkit function if you absolutely have to: http://php.net/runkit_constant_remove Jasper Suhas wrote: Hi, How do I unset a defined variable. e.g. define('AA',1); unset(AA) // gives error any suggestions! Thanks SP -- P

Re: [PHP] unset a constant

2006-03-27 Thread Chris
Suhas wrote: Hi, How do I unset a defined variable. You can't. What do you want to do that for? -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] unset a constant

2006-03-27 Thread Suhas
Hi, How do I unset a defined variable. e.g. define('AA',1); unset(AA) // gives error any suggestions! Thanks SP

Re: [PHP] unset and sessions

2005-12-12 Thread sunaram patir
http://in.php.net/unset On 12/12/05, Eternity Records Webmaster <[EMAIL PROTECTED]> wrote: > I use php 5.0.5 and was wondering when I use $_SESSION would unset() work > the best for getting rid of the values in that array?? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, v

[PHP] unset and sessions

2005-12-12 Thread Eternity Records Webmaster
I use php 5.0.5 and was wondering when I use $_SESSION would unset() work the best for getting rid of the values in that array?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] = '' both do n't do anything.

2004-07-29 Thread Ford, Mike [LSS]
On 28 July 2004 20:17, Daevid Vincent wrote: > No. I'm trying to delete it from PHP memory, but keep the cookie on > their client in the cookie.txt file or wherever it's stored. Where are you doing the test for it -- in the same script, or in a subsequent one? If the former, then I'm confused; i

Re: [PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] = '' both don't do anything.

2004-07-28 Thread Matt M.
> No. I'm trying to delete it from PHP memory, but keep the cookie on their > client in the cookie.txt file or wherever it's stored. > > The idea is for added security. I just don't want traces of it around after > the initial login. I am not sure about deleting a superglobal, but even if you do

RE: [PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] = '' both don't do anything.

2004-07-28 Thread Daevid Vincent
ilto:[EMAIL PROTECTED] > Sent: Wednesday, July 28, 2004 12:03 PM > To: Daevid Vincent > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] > = '' both don't do anything. > > > unset($_COOKIE['foo&#

Re: [PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] = '' both don't do anything.

2004-07-28 Thread Matt M.
> unset($_COOKIE['foo']); > > And also > > $_COOKIE['foo'] = ''; Are you trying to delete the cookie on the client side? if so try: setcookie ('foo', '', time() - 3600); http://us2.php.net/setcookie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

[PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] = '' both don't do anything.

2004-07-28 Thread Daevid Vincent
Linux. PHP5. Maybe I'm doing something wrong, but I've tried both: unset($_COOKIE['foo']); And also $_COOKIE['foo'] = ''; And neither of them seem to do anything. I can still see the cookie and worse, the value if I do foreach ($_COOKIE as $key => $val) echo "$key = $val"; -- PHP General Ma

[PHP] unset empty elements in an array

2004-07-11 Thread Justin French
Hi, Looking for a one-liner to delete all empty elements in an array. I know I can do it with a foreach loop, but I'm hoping that I've missed an existing function in the manual which may already do this, or a simple one-liner to replace the foreach. $v) { if(empty($v)) {

RE: [PHP] unset Fuction

2004-02-10 Thread Oschlies Dirk (Praktikant FV/SLH)
Hello John, > From: JohnT [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 10, 2004 4:54 AM > > Hello, > > mind explain a little bit further cause i'm confused and not > sure if the > fuction really work or something > > [some Code] As far as I know (or understand), unset() will only destr

[PHP] unset Fuction

2004-02-10 Thread JohnT
Hello, mind explain a little bit further cause i'm confused and not sure if the fuction really work or something On 1st example using unset() in a function /// CODE / function foo() { static $a; $a++; echo "$a"; unset($a); } foo(); foo(); foo(); /

Re: [PHP] unset() un-appropriate ?

2003-10-13 Thread Jason Wong
On Monday 13 October 2003 18:47, Ciprian Trofin wrote: > I have a form with 3 checkboxes x1,x2,x3. I want to build an array of > values from the checked boxes; I choosed the following approach: > 1. build an array with all values > 2. eliminate from array the "" values using unset The checkboxes t

Re: [PHP] unset() un-appropriate ?

2003-10-13 Thread David Otton
On Mon, 13 Oct 2003 12:47:44 +0200, you wrote: >I have a form with 3 checkboxes x1,x2,x3. I want to build an array of >values from the checked boxes; I choosed the following approach: >1. build an array with all values >2. eliminate from array the "" values using unset > >For some reason, the code

[PHP] unset() un-appropriate ?

2003-10-13 Thread Ciprian Trofin
I have a form with 3 checkboxes x1,x2,x3. I want to build an array of values from the checked boxes; I choosed the following approach: 1. build an array with all values 2. eliminate from array the "" values using unset CODE: $x = array($_POST['x1'],$_POST['x2'],$_POST['x3']); do { for ($i

Re: [PHP] unset array here?

2002-07-25 Thread Analysis & Solutions
On Thu, Jul 25, 2002 at 10:26:03PM +0200, Bas Jobsen wrote: > Hello, > > I have this example code: > function doprint($a){foreach($a as $value)echo $value;} > doprint(array('1','test','hello','and')); > > Question, is the array in memory after the function call? > So, should it be better to use

[PHP] unset array here?

2002-07-25 Thread Bas Jobsen
Hello, I have this example code: function doprint($a){foreach($a as $value)echo $value;} doprint(array('1','test','hello','and')); Question, is the array in memory after the function call? So, should it be better to use this: function doprint($a){foreach($a as $value)echo $value;} doprint($tem

[PHP] unset key/element in array

2002-06-14 Thread Aljosa Mohorovic
i need to remove elements in array which are empty. this code works but is it ok to do it like this? code: if(in_array("", $people)) unset($people[array_search("", $people)]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] unset($array[value]) does not work?

2002-06-12 Thread Lazor, Ed
It is working. The last two tests you were running weren't actually the same, which was confusing your testing results. I've altered the code a little for ease of testing. It's included below. -Original Message- You will see that $unserialized['foo'] still exists! Can anyone explain me

[PHP] unset($array[value]) does not work?

2002-06-12 Thread Leon Mergen
Hello, I am currently testing out some things with removing elements from arrays, and I find it strange that the following statement does not work for me: unset($array['element']) I wrote a little test script, you can see the source at http://www.antrophia.com/test.txt and the executable at htt

Re: [PHP] UNSET & Arrays

2002-06-06 Thread Jason Caldwell
I was doing something wrong... ;) I figured it out. Sorry for the post -- it was one of those things that took me *forever* to figure it out and when I saw the problem I felt like an idiot -- oh well. Thanks anyway. Jason "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">ne

Re: [PHP] UNSET & Arrays

2002-06-06 Thread Jason Wong
On Friday 07 June 2002 09:04, Jason Caldwell wrote: > i'm trying to unset an array element within my array -- > > my array looks like; > > $foo[0][magazine] > $foo[0][subscription] > $foo[0][term] > $foo[0][rate] > > $foo[1][magazine] > $foo[1][subscription] > $foo[1][term] > $foo[1][rate] > > and

Re: [PHP] UNSET & Arrays

2002-06-06 Thread Jason Caldwell
that didn't work. "Mark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... first try quoting your strings and see if that helps :) $foo[0]["magazine"] On Thu, 6 Jun 2002 18:04:47 -0700, Jason Caldwell wrote: >i'm trying to unset an array element within my array -

Re: [PHP] UNSET & Arrays

2002-06-06 Thread Mark
first try quoting your strings and see if that helps :) $foo[0]["magazine"] On Thu, 6 Jun 2002 18:04:47 -0700, Jason Caldwell wrote: >i'm trying to unset an array element within my array -- > >my array looks like; > >$foo[0][magazine] >$foo[0][subscription] >$foo[0][term] >$foo[0][rate] > >$foo[1

[PHP] UNSET & Arrays

2002-06-06 Thread Jason Caldwell
i'm trying to unset an array element within my array -- my array looks like; $foo[0][magazine] $foo[0][subscription] $foo[0][term] $foo[0][rate] $foo[1][magazine] $foo[1][subscription] $foo[1][term] $foo[1][rate] and so forth -- when i call unset($foo[0]) for example, the entire array goes aw

[PHP] unset() on arrays

2002-04-16 Thread Erik Price
Just a quick question -- the man page for unset() doesn't mention anything about unsetting arrays, but does it work the same way? I have this if/elseif/else statement (pseudocode): $error_msgs = array(); if (there is a problem) { $error_msgs[] = "error message 1"; } elseif (there is a diffe

Re: [PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Bas Jobsen
Hello, > $func = "make_" . $wat; > $temp = $$func($this); I think one $. $func = "make_" . $wat; $temp = $func($this); will work Bas Op donderdag 31 januari 2002 12:17, schreef u: > Hoi Bas, > > $func = "make_" . $wat; > > $temp = $$func($this); > > bvr. > > On Thu, 31 Jan 2002 11:55:12 +0100

Re: [PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 02:55, Bas Jobsen wrote: > Hello, > > > Thanks all. I will rename the second function. > > Now if have: > > if($wat=="naam")$temp=make_naam($this); > else if($wat=="anderenaam")$temp=make_anderenaam($this); > //etc.. > > But i would prefer something like > $temp=make_$wat

Re: [PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread bvr
Hoi Bas, $func = "make_" . $wat; $temp = $$func($this); bvr. On Thu, 31 Jan 2002 11:55:12 +0100, Bas Jobsen wrote: >Hello, > >> Thanks all. I will rename the second function. > >Now if have: > >if($wat=="naam")$temp=make_naam($this); >else if($wat=="anderenaam")$temp=make_anderenaam($this);

Re: [PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Jeff Van Campen
Hey Bas, BV>But i would prefer something like BV>$temp=make_$wat($this); I think you might want something along these lines: eval("make_$wat($this);"); HTH -jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

[PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Bas Jobsen
Hello, > Thanks all. I will rename the second function. Now if have: if($wat=="naam")$temp=make_naam($this); else if($wat=="anderenaam")$temp=make_anderenaam($this); //etc.. But i would prefer something like $temp=make_$wat($this); How can i do this? Tnx, Bas -- PHP General Mailing List (

Re: [PHP] unset a function?

2002-01-30 Thread Bas Jobsen
Hi, Thanks all. I will rename the second function. Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

RE: [PHP] unset a function?

2002-01-30 Thread Philip Olson
> include_once() won't help. In fact, he is including each file only once. > He wants to have a function with the same name in each file. That's the > kicker... oh well that's silly, don't do that. also consider function_exists() regards, Philip Olson -- PHP General Mailing List (http://ww

Re: [PHP] unset a function?

2002-01-30 Thread CC Zona
In article , [EMAIL PROTECTED] (Philip Olson) wrote: > > > include("file1"); > > function_somename(); > > include("file2"); > > function_somename(); > > ?> > > > > file1 and contain a function definition, but the function in both files had

RE: [PHP] unset a function?

2002-01-30 Thread Rick Emery
en Cc: PHP List Subject: Re: [PHP] unset a function? This sounds like a job for include_once www.php.net/include_once regards, Philip Olson On Wed, 30 Jan 2002, Bas Jobsen wrote: > Hello, > > I have this: > include("file1"); > function_somename(); >

Re: [PHP] unset a function?

2002-01-30 Thread Philip Olson
This sounds like a job for include_once www.php.net/include_once regards, Philip Olson On Wed, 30 Jan 2002, Bas Jobsen wrote: > Hello, > > I have this: > include("file1"); > function_somename(); > include("file2"); > function_somename(); > ?> > > file1 and contain a function definition, b

Re: [PHP] unset a function?

2002-01-30 Thread Bas Jobsen
ary 30, 2002 2:52 PM > To: PHP List > Subject: [PHP] unset a function? > > > Hello, > > I have this: > include("file1"); > function_somename(); > include("file2"); > function_somename(); > ?> > > file1 and contain a function definition,

RE: [PHP] unset a function?

2002-01-30 Thread Rick Emery
what happened when you tried unset()? -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 2:52 PM To: PHP List Subject: [PHP] unset a function? Hello, I have this: file1 and contain a function definition, but the function in both files

[PHP] unset a function?

2002-01-30 Thread Bas Jobsen
Hello, I have this: file1 and contain a function definition, but the function in both files had the same name. This will give "Cannot redeclare ". So can i unset the function before the second include? Tnx, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail:

[PHP] unset Cookies

2001-10-22 Thread Michael . Thanry
Hello everyone! Is there a way to unset or expire a cookie which was not set by my pages? Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL

[PHP] unset($PHP_AUTH_USER, $PHP_AUTH_PW)

2001-08-29 Thread Jason Bell
anyone know why this isnt working for me? if (isset($PHP_AUTH_USER) && isset($PHP_AUTH_PW)) { CheckCredentials($PHP_AUTH_USER,$PHP_AUTH_PW); unset ($PHP_AUTH_USER, $PHP_AUTH_PW); } else if ($AuthAction) { auth($AuthAction); }; If someone submits false credentials, the pag

RE: [PHP] unset() in a class

2001-08-28 Thread daniel james
If that's the code you're running, it's got several problems-- 1st, the function is mysql_query() 2nd, the query is built like this: $connection = mysql_connect('host', 'user', 'pass'); $db = mysql_select_db('db', $connection); $query = "SELECT * FROM tablename WHERE primary_key = '$primary_key'

RE: [PHP] unset() in a class

2001-08-28 Thread Glyndower
I need to return a "file not found" if the search item is not found.. tryed my_sql_query(select from table where primary key = $primary key)or die "file not found" that didn't work suggestions anybody? please? purty please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe

[PHP] unset() in a class

2001-08-28 Thread Mig...
Hi Why doesn't unset($this) work inside a instance of a class? I have found a workaround, but it isn't so smart... Laus Brandt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list ad

Re: [PHP] unset()- newbie question

2001-05-22 Thread Chris Sano
"; unset( $array[ 'test' ] ); echo "after " . $array[ 'test' ]; ?> returns: before chris after hence, the unset function works fine for me. what version of php are you running? ""Tom"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I can't seem to get uns

[PHP] unset()- newbie question

2001-05-20 Thread Tom
I can't seem to get unset() to work when I'm strying to delete an element from an array. I have a select list that is populated by an array, and i need to be able to delete items from the list by deleting them from the array, but I don't know how. I tried using unset($array['element']); but i

[PHP] unset()

2001-04-04 Thread Patrick Dunford
I wrote a function inside a file which I included with a require() call. The function takes four arguments by reference (because I need to pass back four values). The first thing it does is to call unset() four times to unset these arguments, so that it can enter new data into them. This will