Re: [PHP] Variable (Class instantiation) collision

2010-10-05 Thread David Harkness
If you have total control over application A which contains the bridge code, the easiest is to change it to use a different global variable, $dbA. This must not be doable or you wouldn't have asked. If you have control over the bridge code, and it alone calls A and B, then you could swap the $db v

Re: [PHP] Variable (Class instantiation) collision

2010-10-05 Thread chris h
Short of refactoring ApplicationB, can you set it up as a SOAP/REST service that AppA calls? On Tue, Oct 5, 2010 at 5:02 PM, Brian Smither wrote: > > >Just to clarify, both packages are instantiating and calling their > >respective classes from the $db var, which is in the global scope. > >Is t

Re: [PHP] Variable (Class instantiation) collision

2010-10-05 Thread Brian Smither
>Just to clarify, both packages are instantiating and calling their >respective classes from the $db var, which is in the global scope. >Is this correct? I would say yes to the way you are asking. Take the following two applications. The four respective statements are in each their respective sc

[PHP] Re: which one is faster

2010-10-05 Thread Jo�o C�ndido de Souza Neto
As I can see, it´d be too much faster to decide by yourself than reading all theese answers and understanding their differences and taking people´s time for nothing. -- João Cândido de Souza Neto "saeed ahmed" escreveu na mensagem news:aanlktikh6g5ilsz3hkxatg=h1wzobgoko7byngo0p...@mail.g

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:58 PM, Steve Staples wrote: > On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: > > On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: > > > > > On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: > > > > On Tue, 2010-10-05 at 15:28 -0400, chris h wrote

Re: [PHP] which one is faster

2010-10-05 Thread Ashley Sheridan
On Tue, 2010-10-05 at 15:58 -0400, Steve Staples wrote: > On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: > > On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: > > > > > On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: > > > > On Tue, 2010-10-05 at 15:28 -0400, chris h wr

Re: [PHP] Variable (Class instantiation) collision

2010-10-05 Thread chris h
Just to clarify, both packages are instantiating and calling their respective database classes from the $db var, which is in the global scope. Is this correct? This is why I hate the global scope, I hate it, I hate it! On Tue, Oct 5, 2010 at 3:47 PM, Brian Smither wrote: > I am running into a v

Re: [PHP] which one is faster

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: > On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: > > > On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: > > > On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: > > > > > > > Benchmark and find out! :) > > > > > > > > Wha

Re: [PHP] which one is faster

2010-10-05 Thread TR Shaw
On Oct 5, 2010, at 3:23 PM, saeed ahmed wrote: > $a = 'hey'; > $b = 'done'; > > $c = $a.$b; > $c = "$a$b"; > > which one is faster for echo $c. Depends upon the platform its running on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:53 PM, Ashley Sheridan wrote: > On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: > > > On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: > > > On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: > > > > > > > Benchmark and find out! :) > > > > > > > > What ar

Re: [PHP] which one is faster

2010-10-05 Thread Ashley Sheridan
On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: > On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: > > On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: > > > > > Benchmark and find out! :) > > > > > > What are you using this for? Unless you are doing something crazy it > > > pr

[PHP] Variable (Class instantiation) collision

2010-10-05 Thread Brian Smither
I am running into a variable collision. The project I'm developing is NOT guaranteed to be operating on PHP5. Any solution I find should (hopefully) be able to run on PHP4 (yes, I know PHP4 is deprecated). I am building a bridge between two third-party applications. Both instantiate their respe

Re: [PHP] which one is faster

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: > On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: > > > Benchmark and find out! :) > > > > What are you using this for? Unless you are doing something crazy it > > probably doesn't matter, and you should pick whichever you feel looks nic

Re: [PHP] which one is faster

2010-10-05 Thread chris h
Saeed here's a quick (and dirty) test I ran: $tests = 100; $start = microtime(true); for ($i=0; $i<$tests; $i++) { $a = md5( rand() ); $b = md5( rand() ); $c = $a.$b; } var_dump( "By concat op:\t". (microtime(true) - $start) ); $start = microtime(true); for ($i=0; $i<$tests; $i++)

Re: [PHP] which one is faster

2010-10-05 Thread Ashley Sheridan
On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: > Benchmark and find out! :) > > What are you using this for? Unless you are doing something crazy it > probably doesn't matter, and you should pick whichever you feel looks nicer > / is easier to code in / etc. > > Chris H. > > On Tue, Oct 5, 2

Re: [PHP] which one is faster

2010-10-05 Thread chris h
Benchmark and find out! :) What are you using this for? Unless you are doing something crazy it probably doesn't matter, and you should pick whichever you feel looks nicer / is easier to code in / etc. Chris H. On Tue, Oct 5, 2010 at 3:23 PM, saeed ahmed wrote: > $a = 'hey'; > $b = 'done'; > >

[PHP] which one is faster

2010-10-05 Thread saeed ahmed
$a = 'hey'; $b = 'done'; $c = $a.$b; $c = "$a$b"; which one is faster for echo $c.

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 14:32 -0400, tedd wrote: > At 1:56 PM -0400 10/5/10, tedd wrote: > >At 12:54 PM +0100 10/5/10, Col Day wrote: > >>Hi Shreyas, > >> > >>Ok, as far as I can tell the script should show "This is an HTML > >>line" reflecting that I am seeing the HTML part of the script > >>follo

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread tedd
At 1:56 PM -0400 10/5/10, tedd wrote: At 12:54 PM +0100 10/5/10, Col Day wrote: Hi Shreyas, Ok, as far as I can tell the script should show "This is an HTML line" reflecting that I am seeing the HTML part of the script followed by "This is a PHP line" to show that PHP is installed and workin

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread tedd
At 12:54 PM +0100 10/5/10, Col Day wrote: Hi Shreyas, Ok, as far as I can tell the script should show "This is an HTML line" reflecting that I am seeing the HTML part of the script followed by "This is a PHP line" to show that PHP is installed and working fine. Col: Do this: 1. Create a f

Re: [PHP] Re: Is it possible to create a global namespace alias?

2010-10-05 Thread David Harkness
On Tue, Oct 5, 2010 at 8:41 AM, Matt Palermo wrote: > I'm assuming there is no way to make a global alias. Can anyone > confirm/deny this? > I reread the documentation on namespaces, and from what I can tell this is no way to do it. Each file maintains its own active namespace *at compile time*

[PHP] Re: Is it possible to create a global namespace alias?

2010-10-05 Thread Matt Palermo
I'm assuming there is no way to make a global alias. Can anyone confirm/deny this? ""Matt Palermo"" wrote in message news:5e7b8989448b45dbbeeb6fb89b3f3...@rachet... Is it possible to create a global namespace alias in PHP or does the alias have to be defined in EVERY file that I use? H

Re: [PHP] file_get_contents() failing on CentOS.

2010-10-05 Thread Adam Richardson
On Tue, Oct 5, 2010 at 6:56 AM, Richard Quadling wrote: > The issue _WAS_ the firewall. > > All sorted. > > Thank you. > > Glad he got it working. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

[PHP] i wanna join

2010-10-05 Thread Xuan Huy
-- Ngô Xuân Huy

RE: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Ford, Mike
> -Original Message- > From: Col Day [mailto:colind...@aol.com] > Sent: 05 October 2010 12:55 > To: php-general@lists.php.net > Subject: Re: [PHP] Re: Continuance of the struggle (trying to > understand) > > Hi Shreyas, > > Ok, as far as I can tell the script should show "This is an HTM

Re: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread musicdev
Hello, remember that for windows, you must also copy the library (libmysql.dll) to window's system32 directory in addition to un-commenting the extension=php_mysql.dll line in php.ini. Also, just in case, ensure that php.ini also has the proper extension directory set, typically c:\php\ext b

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread chris h
"If I paste the script into a web page" What do you mean by "paste the script into a web page"? Can you tell us exactly what you are doing when you do that? Chris. On Tue, Oct 5, 2010 at 7:54 AM, Col Day wrote: > Hi Shreyas, > > Ok, as far as I can tell the script should show "This is an H

RE: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 14:02 +0100, Jason wrote: > >-Original Message- > >From: Steve Staples [mailto:sstap...@mnsi.net] > >Sent: 05 October 2010 13:55 > >To: php-general > >Subject: Re: Fw: [PHP] Connecting to MySql with PHP > > > >On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote: > >> -

RE: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Jason
>-Original Message- >From: Steve Staples [mailto:sstap...@mnsi.net] >Sent: 05 October 2010 13:55 >To: php-general >Subject: Re: Fw: [PHP] Connecting to MySql with PHP > >On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote: >> - Original Message - >> From: sueandant >> To: a...@ash

Re: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote: > - Original Message - > From: sueandant > To: a...@ashleysheridan.co.uk > Sent: Monday, October 04, 2010 10:29 PM > Subject: Re: [PHP] Connecting to MySql with PHP > > > Thanks Ash > > Where do I find the PHP mysql module? I have

Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread sueandant
- Original Message - From: sueandant To: a...@ashleysheridan.co.uk Sent: Monday, October 04, 2010 10:29 PM Subject: Re: [PHP] Connecting to MySql with PHP Thanks Ash Where do I find the PHP mysql module? I have uncommented both the extensions php-mysql.dll and php-mysqli.dll; do I

RES: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Alejandro Michelin Salomon
Sueandant : Reading more carefully your email, and search for this error in the net. Y find this page http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/ Try this Alejandro M.S. -Mensagem original- De: Alejandro Michelin Salomon [mailto:amichel...@hotmail.com] Enviada

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Steve Staples
Col: If i am reading this correctly, then i think you're looking at this all wrong. If you're working within some kind of page, stored outside of the http://localhost served by apache, like say the .php file is on the desktop... then yeah, you're not going to get the PHP information displayed. (

RES: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Alejandro Michelin Salomon
Sueandant : Goto your my.ini file In my case located in C:\Arquivos de programas\MySQL\MySQL Server 5.1 Search is this configuration option is enabled => skip-networking And comment to enabled listen on a TCP/IP port. Default port 3306 Or Put => enable-named-pipe to enable named pipes Alejandr

[PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Col Day
LOL! This is WITH xammp!! "Gary" wrote in message news:i8f26m$j4...@dough.gmane.org... Col Day wrote: ""Col Day"" wrote in message news:23.81.45586.2820b...@pb1.pair.com... PHP Test This is an HTML line This is a PHP line"; phpinfo(); ?>

[PHP] Re: New to PHP and struggling with the basics

2010-10-05 Thread Col Day
Thanks Gary! Nice to know I'm not the only one who has struggled with the Basics. Hopefully I can get my brain around it sometime soon. Cheers Col. "Gary" wrote in message news:i8f1r9$j4...@dough.gmane.org... Col Day wrote: Yes I did install apache then php, however I tried to follow the

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Col Day
Hi Shreyas, Ok, as far as I can tell the script should show "This is an HTML line" reflecting that I am seeing the HTML part of the script followed by "This is a PHP line" to show that PHP is installed and working fine. If I view the script directly in IE by going to http://localhost/phptest.

Re: [PHP] Filesystem path creation function

2010-10-05 Thread Richard Quadling
On 5 October 2010 09:07, Gary wrote: > Does such a thing exist in php? My searches have lead nowhere. > > What I am looking for is a function which you would pass two parts of a > path to (which might be a directory and a filename, say) and it would > return a string containing the parameters sepa

Re: [PHP] Filesystem path creation function

2010-10-05 Thread Richard Quadling
On 5 October 2010 09:07, Gary wrote: > Does such a thing exist in php? My searches have lead nowhere. > > What I am looking for is a function which you would pass two parts of a > path to (which might be a directory and a filename, say) and it would > return a string containing the parameters sepa

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Shreyas Agasthya
Col, Can you let us know what exactly you see when you say http://localhost:/phptest.php ? Regards, Shreyas On Tue, Oct 5, 2010 at 4:20 PM, Col Day wrote: > > ""Col Day"" wrote in message > news:23.81.45586.2820b...@pb1.pair.com... > > Hi all, >> >> After my escapades with the real basics a

Re: [PHP] file_get_contents() failing on CentOS.

2010-10-05 Thread Richard Quadling
The issue _WAS_ the firewall. All sorted. Thank you. -- 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

[PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread Col Day
""Col Day"" wrote in message news:23.81.45586.2820b...@pb1.pair.com... Hi all, After my escapades with the real basics and realizing my laptop wasn't logged on as Administrator, I now am trying to work out why this script works sometimes but not others. PHP Test This

[PHP] Continuance of the struggle (trying to understand)

2010-10-05 Thread Col Day
Hi all, After my escapades with the real basics and realizing my laptop wasn't logged on as Administrator, I now am trying to work out why this script works sometimes but not others. PHP Test This is an HTML line This is a PHP line"; phpinfo(); ?> If

[PHP] Bug #52782: DOMDocument subclass forgotten using ->ownerDocument after closure

2010-10-05 Thread Jan Moesen
(I filed bug #52782 about a month ago, but have not received any reply. I am posting here to try and get some feedback on it.) We have custom XML document and element classes that extend the original DOMDocument and DOMElement classes for convenience. There is a class that uses an instance of