|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 7 Dec 2005 03:33:25 -0000 Issue 3836
php-general-digest-help
lists.php.net
Date: Tue Dec 06 2005 - 21:33:25 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 7 Dec 2005 03:33:25 -0000 Issue 3836
Topics (messages 226933 through 227015):
Re: What software do you use for writing PHP?
226933 by: John Nichel
226934 by: afan.afan.net
226935 by: Al
226936 by: Jason Petersen
226938 by: Chris Boget
226939 by: Stephen Leaf
226941 by: David Grant
226943 by: Stephen Leaf
226945 by: David Grant
226946 by: Arno Kuhl
226947 by: Jesper Gran
226960 by: Mark Steudel
226962 by: Richard Davey
226963 by: M. Sokolewicz
226967 by: Richard Davey
226968 by: Michael Crute
226969 by: Chris Boget
226970 by: Mark Steudel
226971 by: Ben
226972 by: Eric Gorr
226973 by: Jay Blanchard
226974 by: Michael Crute
226975 by: Stephen Leaf
226977 by: Ben
226978 by: Ben
226982 by: Richard Davey
226983 by: Jay Blanchard
226984 by: Chris Boget
226988 by: John Nichel
226990 by: Eric Gorr
226991 by: Mark Steudel
226992 by: Eric Gorr
226997 by: Jochem Maas
227005 by: Curt Zirzow
227008 by: Michael Hulse
Re: Unnecessary if statement? Programming technique
226937 by: Jared Williams
226940 by: David Grant
226944 by: Steve McGill
226950 by: David Grant
226959 by: tg-php.gryffyndevelopment.com
Communicate with Windows Media Server with PHP
226942 by: Graham Anderson
Forum
226948 by: Andy Pieters
226951 by: John Nichel
226952 by: Jay Blanchard
226953 by: Andy Pieters
226954 by: Robert Cummings
226955 by: John Nichel
226956 by: Larry E. Ullman
226957 by: John Nichel
226958 by: David Grant
226993 by: Dotan Cohen
226995 by: Dotan Cohen
Re: HTTP User Authentication Problems
226949 by: Rahul S. Johari
Arrays
226961 by: Ben Miller
226964 by: Jay Blanchard
226965 by: Richard Davey
226976 by: tg-php.gryffyndevelopment.com
Assigns True but not false?
226966 by: Gabe
226994 by: Andy Pieters
227004 by: Curt Zirzow
Re: SSI problem with php after 4.3.10 -> 4.4.1 upgrade
226979 by: kristina clair
Re: Redirects Safari vs Others
226980 by: Mark Steudel
226985 by: Dan Lowe
226987 by: Jay Blanchard
226989 by: Mark Steudel
Urlencode vs htmlentities
226981 by: Mark Steudel
227009 by: comex
227014 by: Curt Zirzow
Migration to PHP5
226986 by: Christian Calloway
references, circular references, oop, and garbage collection in PHP5
226996 by: Alan Pinstein
226998 by: Ray Hauge
227015 by: Curt Zirzow
Optimizing Images
226999 by: Tim Traver
227000 by: John Hinton
Web calendar and online Dairy
227001 by: Vikram Kumar
227003 by: Terence
Debuggers on Windows Servers
227002 by: Mark Steudel
Classes/Objects - Books/Links?
227006 by: Michael Hulse
227007 by: Chris Shiflett
227010 by: Michael Hulse
227013 by: Mark Steudel
XmlWriter::writeDTD bug...
227011 by: Jared Williams
私の彼は漫画
227012 by: ovxefq5
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
David Grant wrote:
> Hi Jeff,
>
> Jeff McKeon wrote:
>
>>What is it you like about Zend Studio?
>
>
> * Code completion
> * Syntax highlighting for PHP, HTML and CSS
> * Manual pages
> * Debugging
> * Code examination
> * PHPDoc
> * CVS & SVN support
Also:
MySQL Tools
SFTP & FTP
Projects
PHPDocumentor
--
John C. Nichel IV
Programmer/System Admin (ワberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
HomeSite.
I tried several others but always came back to HomeSite. :)
-afan
Jeff McKeon wrote:
> Hey all,
> Forever now I've been using Frontpage for
> all my web work including php.
> I'm sure there's better software out there that is more
> suited to writing and editing PHP pages.
> What do you all use? Now: Zend Studio
attached mail follows:
Jeff McKeon wrote:
> Hey all,
>
> Forever now I've been using Frontpage for all my web work including php.
> I'm sure there's better software out there that is more suited to
> writing and editing PHP pages. What do you all use?
>
> Thanks,
>
> Jeff
http://www.waterproof.fr/products/PHPEdit/
attached mail follows:
On 12/6/05, Jeff McKeon <jmckeon
telaurus.com> wrote:
>
> Hey all,
>
> Forever now I've been using Frontpage for all my web work including php.
> I'm sure there's better software out there that is more suited to
> writing and editing PHP pages. What do you all use?
>
Vim is my editor of preference. If I have to use Windows, I usually go with
Homesite (because I already have a licensed copy) or Textpad (because it's
better than Notepad).
IDEs? Who needs 'em ;)
Best,
Jason
attached mail follows:
> HomeSite.
> I tried several others but always came back to HomeSite. :)
I was a massive HomeSite proponent until I started using SlickEdit.
Once I did, I never looked back.
thnx,
Chris
attached mail follows:
KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention.
And because it's part of KDE all the kioslaves come with. Which means editing
sites over ftp, ftps, ssh and many others is possible.
Like the Vim guy said. DEs? who needs them :)
On Tuesday 06 December 2005 08:15, Jeff McKeon wrote:
> Hey all,
>
> Forever now I've been using Frontpage for all my web work including php.
> I'm sure there's better software out there that is more suited to
> writing and editing PHP pages. What do you all use?
>
> Thanks,
>
> Jeff
attached mail follows:
Stephen Leaf wrote:
> KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention.
> And because it's part of KDE all the kioslaves come with. Which means editing
> sites over ftp, ftps, ssh and many others is possible.
> Like the Vim guy said. DEs? who needs them :)
Mmmm, reminds me of Kate! When I use KDE, I used Kate for all non-PHP
coding tasks, because it has great highlighting, and code folding too. :)
Cheers,
David Grant
--
David Grant
http://www.grant.org.uk/
attached mail follows:
As far as I can tell kate has a kwrite embedded :) I'm sure that's not the
case but it seems like it. everything kwrite can do so can kate. only it has
more options that I'd never used.
And yes Code folding is nice don't use it much tho.
On Tuesday 06 December 2005 09:48, David Grant wrote:
> Stephen Leaf wrote:
> > KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention.
> > And because it's part of KDE all the kioslaves come with. Which means
> > editing sites over ftp, ftps, ssh and many others is possible.
> > Like the Vim guy said. DEs? who needs them :)
>
> Mmmm, reminds me of Kate! When I use KDE, I used Kate for all non-PHP
> coding tasks, because it has great highlighting, and code folding too. :)
>
> Cheers,
>
> David Grant
attached mail follows:
According to http://kate.kde.org/info.php, kate and kwrite (and Quanta)
all use katepart (a rewrite of kwrite).
Stephen Leaf wrote:
> As far as I can tell kate has a kwrite embedded :) I'm sure that's not the
> case but it seems like it. everything kwrite can do so can kate. only it has
> more options that I'd never used.
>
> And yes Code folding is nice don't use it much tho.
>
> On Tuesday 06 December 2005 09:48, David Grant wrote:
>> Stephen Leaf wrote:
>>> KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention.
>>> And because it's part of KDE all the kioslaves come with. Which means
>>> editing sites over ftp, ftps, ssh and many others is possible.
>>> Like the Vim guy said. DEs? who needs them :)
>> Mmmm, reminds me of Kate! When I use KDE, I used Kate for all non-PHP
>> coding tasks, because it has great highlighting, and code folding too. :)
>>
>> Cheers,
>>
>> David Grant
>
--
David Grant
http://www.grant.org.uk/
attached mail follows:
Nusphere PhpED and love it. Tried a few other editors but stayed with PhpED
now for the last year and about to renew my subscription. Excellent project
management, brilliant debugger (local and remote), code error detection and
highlighting, fast (much faster than the java editors), able to handle huge
projects, and very stable. Not as expensive as the Zend equivalent (last
time I checked) and in my opinion it's much better. Good support from the
forum and quick responses from the support desk. I keep checking out the new
editors and new versions of old editors as they come out but nothing yet to
match PhpED. I develop on Windows but there's a Linux version too (which I
haven't tried). If you're looking for a professional PHP IDE you won't find
better. And BTW I don't work for Nusphere, I just really like their product.
Arno
________________________
DotContent
Professional Content Management Solutions
www.dotcontent.net
-----Original Message-----
From: Jeff McKeon [mailto:jmckeon
telaurus.com]
Sent: 06 December 2005 04:15
To: php
Subject: [PHP] What software do you use for writing PHP?
Hey all,
Forever now I've been using Frontpage for all my web work including php.
I'm sure there's better software out there that is more suited to
writing and editing PHP pages. What do you all use?
Thanks,
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.12/192 - Release Date: 2005/12/05
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.12/192 - Release Date: 2005/12/05
attached mail follows:
If you're allready using Visul Studio for your windows applications,
take a look at VS.Php from Jcx.Software.
http://www.jcxsoftware.com/
Jesper
attached mail follows:
I primarily code in Dreamweaver 8. Two of my favorite features that were
added from MX are as follows:
1. Code folding, basically you can collapse blocks of code. If you have to
work with other peoples code, matching braces and code folding is an awesome
way of just seeing the logical flow of the code, and hide all the details.
DW 8 code folding is great because you can select any amount of code and
collapse it. The bummer about dreamweaver is that it doesn't detect
functions and add a collapse handle to it like Zend Studio, or have the
default to automatically collapse functions when you open a page like Zend
Studio.
2. The built in FTP client. You can set it so that when you save it auto
uploads the file to the site. They also put the upload/download process into
a separate process. This means that you can download or upload a bunch of
files and still continue to work on files. One thing that bugs me is that
the dialogue box always comes up and you have to click around or minimize it
to hide it, why isn't there an option to just keep it hidden on upload?
I used Zend Studio for a month, in hopes that I would be able to figure out
how to install the whole IDE with server on my machine. I wanted to use the
debugging features in it, but I have never been able to get all the pieces
installed correctly AND gotten a work flow down where I could use the
debugger effectively. ZS has code folding too, but just for functions.
Someone else mentioned support for phpDoc, this is an awesome time saver if
you want to provide clear documentation in phpdoc format. One big bummer on
ZS was that it didn't have a built in FTP client. A work around is to work
directly off the server.
I tried Magumas Workbench product for a little bit, but it seemed very
mickey mouse compared to ZS and DW. But I'm sure it's really a good product
and I just didn't' give it a chance.
I have a soft spot for CoffeeCup editor as it was my first editor beyond
notepad. I still download each update and install it, though I never use it
anymore ....
Mark
-----Original Message-----
From: Jeff McKeon [mailto:jmckeon
telaurus.com]
Sent: Tuesday, December 06, 2005 6:15 AM
To: php
Subject: [PHP] What software do you use for writing PHP?
Hey all,
Forever now I've been using Frontpage for all my web work including php.
I'm sure there's better software out there that is more suited to writing
and editing PHP pages. What do you all use?
Thanks,
Jeff
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
On 6 Dec 2005, at 17:25, Mark Steudel wrote:
> ZS has code folding too, but just for functions.
> Someone else mentioned support for phpDoc, this is an awesome time
> saver if
> you want to provide clear documentation in phpdoc format. One big
> bummer on
> ZS was that it didn't have a built in FTP client. A work around is
> to work
> directly off the server.
It doesn't have a fully fledged FTP client, but it can connect to,
edit files on, and upload to an FTP server, so it's the same end result.
What swings it most for me (I use ZS exclusively) is the function /
method / class insight, which DW doesn't have. Oh and the svn
integration is nice too (although very badly documented)
Cheers,
Rich
--
http://www.corephp.co.uk
PHP Development Services
attached mail follows:
Jason Petersen wrote:
> On 12/6/05, Jeff McKeon <jmckeon
telaurus.com> wrote:
>
>>Hey all,
>>
>>Forever now I've been using Frontpage for all my web work including php.
>>I'm sure there's better software out there that is more suited to
>>writing and editing PHP pages. What do you all use?
>>
>
>
> Vim is my editor of preference. If I have to use Windows, I usually go with
> Homesite (because I already have a licensed copy) or Textpad (because it's
> better than Notepad).
>
> IDEs? Who needs 'em ;)
>
> Best,
> Jason
>
same here :)
Vim on UNIX machines, and Textpad on Windows
both very good, simple, quick editors
- tul
attached mail follows:
On 6 Dec 2005, at 17:36, M. Sokolewicz wrote:
> Jason Petersen wrote:
>> On 12/6/05, Jeff McKeon <jmckeon
telaurus.com> wrote:
>> Vim is my editor of preference. If I have to use Windows, I
>> usually go with
>> Homesite (because I already have a licensed copy) or Textpad
>> (because it's
>> better than Notepad).
>> IDEs? Who needs 'em ;)
>>
> same here :)
> Vim on UNIX machines, and Textpad on Windows
>
> both very good, simple, quick editors
I used to think like that (10 years ago maybe), but then I realised
that actually, my time is quite valuable and worth a fair bit, and
it's best not to waste it.
Cheers,
Rich
--
http://www.corephp.co.uk
PHP Development Services
attached mail follows:
On 12/6/05, Richard Davey <rich
corephp.co.uk> wrote:
> On 6 Dec 2005, at 17:36, M. Sokolewicz wrote:
>
> > Jason Petersen wrote:
> >> On 12/6/05, Jeff McKeon <jmckeon
telaurus.com> wrote:
> >> Vim is my editor of preference. If I have to use Windows, I
> >> usually go with
> >> Homesite (because I already have a licensed copy) or Textpad
> >> (because it's
> >> better than Notepad).
> >> IDEs? Who needs 'em ;)
> >>
> > same here :)
> > Vim on UNIX machines, and Textpad on Windows
> >
> > both very good, simple, quick editors
>
> I used to think like that (10 years ago maybe), but then I realised
> that actually, my time is quite valuable and worth a fair bit, and
> it's best not to waste it.
Indeed, if you are bad at VI things go very slow but if you are good
at VI (I am semi-good) you can code FAR faster than any GUI I have
ever used.
Plus you can use VIM on Windows too.
-Mike
--
________________________________
Michael E. Crute
Software Developer
SoftGroup Development Corporation
Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.
attached mail follows:
> I primarily code in Dreamweaver 8. Two of my favorite features that were
> added from MX are as follows:
> 1. Code folding, basically you can collapse blocks of code.
SlickEdit has this feature.
> 2. The built in FTP client.
This one as well. I used Dreamweaver a while back (admittedly an older
version) but I couldn't stand it. But that's IMO.
thnx,
Chris
attached mail follows:
When you say SlickEdit has a ftp client built in, is it a separate window
that gets launched, or is it more integrated, like you can just right click
on your list of files and say "put" these files up on the server. For me
just being able to save and have the file get uploaded saves me a lot of
extra clicks. DW's synchornization features are also handy if you are trying
to get just the lastest files instead of the whole site.
-----Original Message-----
From: Chris Boget [mailto:chris.boget
wild.net]
Sent: Tuesday, December 06, 2005 10:11 AM
To: Mark Steudel; 'Jeff McKeon'; 'php'
Subject: Re: [PHP] What software do you use for writing PHP?
> I primarily code in Dreamweaver 8. Two of my favorite features that
> were added from MX are as follows:
> 1. Code folding, basically you can collapse blocks of code.
SlickEdit has this feature.
> 2. The built in FTP client.
This one as well. I used Dreamweaver a while back (admittedly an older
version) but I couldn't stand it. But that's IMO.
thnx,
Chris
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
Michael Crute said the following on 12/06/2005 09:53 AM:
> On 12/6/05, Richard Davey <rich
corephp.co.uk> wrote:
> Indeed, if you are bad at VI things go very slow but if you are good
> at VI (I am semi-good) you can code FAR faster than any GUI I have
> ever used.
If you take the upfront time to learn how to use VIM you'll discover it
is very powerful and very quick. It's even better if you use it in
conjunction with screen.
> Plus you can use VIM on Windows too.
Yes, though if you're stuck on Windows I'd suggest using VIM via Putty
(even if you're using Putty to SSH to your local machine) so that you
can resize your shell window horizontally as well as vertically.
- Ben
attached mail follows:
Quoting Torgny Bjers <torgny
xorcode.com>:
> I recommend Zend Studio if you can afford it since it has a GUI for
> both Windows and Linux
<FlameBate>And for those interested in using a real computer</FlameBate>, it's
GUI also runs under MacOSX.
http://zend.com/store/products/zend-studio/requirements.php
attached mail follows:
[snip]
<FlameBate>And for those interested in using a real computer</FlameBate>,
it's
GUI also runs under MacOSX.
[/snip]
If they are "real" why aren't there more of them?
attached mail follows:
On 12/6/05, Ben <ben
emediastudios.com> wrote:
> Michael Crute said the following on 12/06/2005 09:53 AM:
> > On 12/6/05, Richard Davey <rich
corephp.co.uk> wrote:
> > Indeed, if you are bad at VI things go very slow but if you are good
> > at VI (I am semi-good) you can code FAR faster than any GUI I have
> > ever used.
>
> If you take the upfront time to learn how to use VIM you'll discover it
> is very powerful and very quick. It's even better if you use it in
> conjunction with screen.
>
> > Plus you can use VIM on Windows too.
>
> Yes, though if you're stuck on Windows I'd suggest using VIM via Putty
> (even if you're using Putty to SSH to your local machine) so that you
> can resize your shell window horizontally as well as vertically.
>
> - Ben
Well if you properly setup GVIM (turn off the menus and toolbars) you
have about the same thing. Thats what I use at work instead of
notepad. It works really well.
My _gvimrc file looks like so and accomplishes exactly what you are
saying with GVIM
au GUIEnter * simalt ~x
set guioptions=
syn on
set guifont=Lucida_Console:h9:cANSI
set wrap!
set nu
set tabstop=4
emenu Edit.Color Scheme.torte
set nocp
set bs=2
set swapfile!
-Mike
--
________________________________
Michael E. Crute
Software Developer
SoftGroup Development Corporation
Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.
attached mail follows:
Wow.. Linux must really be real then.. look at all the distributions , kernel
patch sets, Window managers, etc.</sarcasm>
# of programs means nothing. it's the quality of the programs.
And yes I am a linux user ;)
On Tuesday 06 December 2005 13:24, Jay Blanchard wrote:
> [snip]
> <FlameBate>And for those interested in using a real computer</FlameBate>,
> it's
> GUI also runs under MacOSX.
> [/snip]
>
> If they are "real" why aren't there more of them?
attached mail follows:
Jay Blanchard said the following on 12/06/2005 11:24 AM:
> [snip]
> <FlameBate>And for those interested in using a real computer</FlameBate>,
> it's
> GUI also runs under MacOSX.
> [/snip]
>
> If they are "real" why aren't there more of them?
'cause it's real expensive ;-).
- Ben
attached mail follows:
Jay Blanchard said the following on 12/06/2005 11:24 AM:
> [snip]
> <FlameBate>And for those interested in using a real computer</FlameBate>,
> it's
> GUI also runs under MacOSX.
> [/snip]
>
> If they are "real" why aren't there more of them?
'cause it's real expensive ;-).
- Ben
attached mail follows:
On 6 Dec 2005, at 19:24, Jay Blanchard wrote:
> [snip]
> <FlameBate>And for those interested in using a real computer</
> FlameBate>,
> it's
> GUI also runs under MacOSX.
> [/snip]
>
> If they are "real" why aren't there more of them?
Because they have 'real' price tags. Shame really, as OS X pisses all
over Windows from a great height. Oh well, nothing wrong with being
in an elite minority ;)
Cheers,
Rich
--
http://www.corephp.co.uk
PHP Development Services
attached mail follows:
[snip]
> [snip]
> <FlameBate>And for those interested in using a real computer</
> FlameBate>,
> it's
> GUI also runs under MacOSX.
> [/snip]
>
> If they are "real" why aren't there more of them?
Because they have 'real' price tags. Shame really, as OS X pisses all
over Windows from a great height. Oh well, nothing wrong with being
in an elite minority ;)
[/snip]
I wish, oh how I wish (and if you have been reading this list for any amount
of time in the past 6 months, you'd know) that Santa Claus would bring me
BSD OS's on all of my servers and give our network personel the cajone's to
deal with the change. Please Santa? If you give me this I promise to never
ask for anything more than peace on Earth, goodwill towards men ever again.
Promise.
attached mail follows:
> When you say SlickEdit has a ftp client built in, is it a separate window
> that gets launched, or is it more integrated, like you can just right
> click
> on your list of files and say "put" these files up on the server.
It's integrated.
thnx,
Chris
attached mail follows:
Jay Blanchard wrote:
> [snip]
>
>>[snip]
>><FlameBate>And for those interested in using a real computer</
>>FlameBate>,
>>it's
>>GUI also runs under MacOSX.
>>[/snip]
>>
>>If they are "real" why aren't there more of them?
>
>
> Because they have 'real' price tags. Shame really, as OS X pisses all
> over Windows from a great height. Oh well, nothing wrong with being
> in an elite minority ;)
> [/snip]
>
> I wish, oh how I wish (and if you have been reading this list for any amount
> of time in the past 6 months, you'd know) that Santa Claus would bring me
> BSD OS's on all of my servers and give our network personel the cajone's to
> deal with the change. Please Santa? If you give me this I promise to never
> ask for anything more than peace on Earth, goodwill towards men ever again.
> Promise.
>
Bill's gonna get mad at you. ;)
--
John C. Nichel IV
Programmer/System Admin (ワberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
> On 6 Dec 2005, at 19:24, Jay Blanchard wrote:
>
>> [snip]
>> <FlameBate>And for those interested in using a real computer</ FlameBate>,
>> it's
>> GUI also runs under MacOSX.
>> [/snip]
>>
>> If they are "real" why aren't there more of them?
Far to many people have fallen victim to the deception field emanating from
Microsoft. The only known cure, barring exceptional innate immunity, is to be
exposed to Steve's Reality Distortion Field, which counteracts the deception
affects and allows people to recognize the truth.
attached mail follows:
Neat, I'll have to check it out.
-----Original Message-----
From: Chris Boget [mailto:chris.boget
wild.net]
Sent: Tuesday, December 06, 2005 12:14 PM
To: Mark Steudel; 'php'
Subject: Re: [PHP] What software do you use for writing PHP?
> When you say SlickEdit has a ftp client built in, is it a separate
> window that gets launched, or is it more integrated, like you can just
> right click on your list of files and say "put" these files up on the
> server.
It's integrated.
thnx,
Chris
attached mail follows:
> Jason Petersen wrote:
>> Vim is my editor of preference. If I have to use Windows, I usually go with
>> Homesite (because I already have a licensed copy) or Textpad (because it's
>> better than Notepad).
>>
>> IDEs? Who needs 'em ;)
Who? Anyone who understands just how useful a debugger can be in increasing
productivity, when used properly (i.e. one should not become dependent upon
using the debugger to catch every coding error) ... which is the
primary reason
why I would recommend Zend Studio.
attached mail follows:
John Nichel wrote:
> Jay Blanchard wrote:
>
>> [snip]
>>
>>> [snip]
>>> <FlameBate>And for those interested in using a real computer</
>>> FlameBate>,
>>> it's
>>> GUI also runs under MacOSX.
>>> [/snip]
>>>
>>> If they are "real" why aren't there more of them?
>>
>>
>>
>> Because they have 'real' price tags. Shame really, as OS X pisses all
>> over Windows from a great height. Oh well, nothing wrong with being
>> in an elite minority ;)
>> [/snip]
>>
>> I wish, oh how I wish (and if you have been reading this list for any
>> amount
>> of time in the past 6 months, you'd know) that Santa Claus would
>> bring me
>> BSD OS's on all of my servers and give our network personel the
>> cajone's to
>> deal with the change. Please Santa? If you give me this I promise to
>> never
>> ask for anything more than peace on Earth, goodwill towards men ever
>> again.
>> Promise.
>>
>
> Bill's gonna get mad at you. ;)
>
ballmer's gonna throw chairs at jay ;-)
attached mail follows:
On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote:
> Jason Petersen wrote:
> >On 12/6/05, Jeff McKeon <jmckeon
telaurus.com> wrote:
> >
> >>Hey all,
> >>
> >>Forever now I've been using Frontpage for all my web work including php.
> >>I'm sure there's better software out there that is more suited to
> >>writing and editing PHP pages. What do you all use?
> >>
> >
> >
> >Vim is my editor of preference. If I have to use Windows, I usually go
> >with
> >Homesite (because I already have a licensed copy) or Textpad (because it's
> >better than Notepad).
> >
> >IDEs? Who needs 'em ;)
> >
> >Best,
> >Jason
> >
> same here :)
> Vim on UNIX machines, and Textpad on Windows
man you guys are wimps.. gvim on windows... :)
Curt.
--
cat .signature: No such file or directory
attached mail follows:
On Dec 6, 2005, at 6:38 PM, Curt Zirzow wrote:
> On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote:
>> Jason Petersen wrote:
>>> On 12/6/05, Jeff McKeon <jmckeon
telaurus.com> wrote:
>>>
>>>> Hey all,
>>>>
>>>> Forever now I've been using Frontpage for all my web work including
>>>> php.
>>>> I'm sure there's better software out there that is more suited to
>>>> writing and editing PHP pages. What do you all use?
>>>>
>>>
>>>
>>> Vim is my editor of preference. If I have to use Windows, I usually
>>> go
>>> with
>>> Homesite (because I already have a licensed copy) or Textpad
>>> (because it's
>>> better than Notepad).
>>>
>>> IDEs? Who needs 'em ;)
>>>
>>> Best,
>>> Jason
>> same here :)
>> Vim on UNIX machines, and Textpad on Windows
Shooooot... BBEdit[1] & Dreamweaver[2] on a Mac[3] baby!
[1]http://www.barebones.com/products/bbedit/index.shtml
[2]http://www.macromedia.com/software/dreamweaver/
[3]http://www.apple.com/
attached mail follows:
Hi,
Why not
for ($i = 0; $i < 1000000/100; ++$i)
{
for ($j = 0; $j < 100; ++$j)
{
// do something standard
}
// do something special for this occurence
}
Jared
> -----Original Message-----
> From: Steve McGill [mailto:steve
bluearena.com]
> Sent: 06 December 2005 10:18
> To: php-general
lists.php.net
> Subject: [PHP] Unnecessary if statement? Programming technique
>
> Hi everyone
>
> Quick question:
>
> If I have such a loop:
>
> <?
> for($i=0;$i<1000000;$i++) {
> if($i==100) {
>
> }
> // do something standard
> }
> ?>
>
> In this case it seems such a waste that the if() statement is
> done 999999 times when it's not needed. Is there any obvious
> trick that I am missing?
> I'm not sure how taxing a simple if() statement is on a
> server, maybe it's negligible, or is it something to worry about?
>
> Something which I'd prefer NOT to do:
>
> <?
> for($i=0;$i<100;$i++) {
> // do something standard
> }
>
> // do something special for $i = 100
>
> for($i=101;$i<1000000;$i++) {
> // do something standard
> }
> ?>
>
> as I would have have to either keep two copies of the code or
> write a function just for this purpose, which hardly seems worth it.
>
> Thanks to anyone who takes the time to think about my
> question and/or respond.
>
> Best wishes,
>
> Steve McGill
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Jared Williams wrote:
> Why not
>
> for ($i = 0; $i < 1000000/100; ++$i)
This involves dividing 1000000 by 100 for each iteration of the loop.
It would be better to test against 10000.
There is also the unwanted side-effect of executing the code on each
hundredth iteration, which is unwanted (as far as I understand the
problem). :)
It would be interesting if Steve could divulge the greater problem that
he is seeking a solution to.
Cheers,
David
--
David Grant
http://www.grant.org.uk/
attached mail follows:
Hi,
David is right about the unwanted side-effect. Thanks for the idea though.
Unfortunately the 'greater problem' is not so great, I've just been doing
this for a while now and find myself programming loops like these so often
and I've never got round to testing if a simple IF statement is a major
drain on the CPU. Somehow I doubt it.
I got this reply from someone direct to my mail address, which seems to sum
it up:
--
In truth you are not evaluating the whole if block just the condition
and since its such a simple condition I can't see how it would be at
all taxing on the server. In your specific case I can't think of a
better way to do it either.
--
I'll try and think of a better example:
<?
$bool = true; // this is set dynamically and not known in advance
while(true) {
if($bool) { // this condition tested in every single loop
// do first code
} else {
// do second code
}
}
?>
and I am wondering if the compiler is smart enough to turn this into:
<?
$bool = true; // this is set dynamically and not known in advance
if($bool) { // this condition only tested once
while(true) {
// do first code
}
} else {
while(true) {
// do second code
}
}
?>
I realise this might be hard to follow without giving specific examples and
code.
In this case, the coding style of the 2nd example seems far better, but
sometimes the 2 blocks of code are practically identical and it's a
programmer's nightmare to have the blocks of code in 2 places and to
remember to keep them both updated.
I'm also assuming that using function calls is also much slower than
evaluating a very simple IF statement.
Thanks for your interest.
Best wishes,
Steve
"David Grant" <david
grant.org.uk> schreef in bericht
news:4395B271.4030303
grant.org.uk...
> Jared Williams wrote:
>> Why not
>>
>> for ($i = 0; $i < 1000000/100; ++$i)
>
> This involves dividing 1000000 by 100 for each iteration of the loop.
> It would be better to test against 10000.
>
> There is also the unwanted side-effect of executing the code on each
> hundredth iteration, which is unwanted (as far as I understand the
> problem). :)
>
> It would be interesting if Steve could divulge the greater problem that
> he is seeking a solution to.
>
> Cheers,
>
> David
> --
> David Grant
> http://www.grant.org.uk/
attached mail follows:
Hi,
I imagine this kind of thing is not especially taxing on the processor,
especially if the condition is a fairly simple comparison. That said, I
have very little understanding aside from my own limited experience of
what runs slowly!
If you're worried about code maintenance, then move the code out to a
function and pass the parts that vary as parameters.
Cheers,
David Grant
Steve McGill wrote:
> Hi,
> David is right about the unwanted side-effect. Thanks for the idea though.
> Unfortunately the 'greater problem' is not so great, I've just been doing
> this for a while now and find myself programming loops like these so often
> and I've never got round to testing if a simple IF statement is a major
> drain on the CPU. Somehow I doubt it.
> I got this reply from someone direct to my mail address, which seems to sum
> it up:
>
> --
> In truth you are not evaluating the whole if block just the condition
> and since its such a simple condition I can't see how it would be at
> all taxing on the server. In your specific case I can't think of a
> better way to do it either.
> --
>
> I'll try and think of a better example:
>
> <?
> $bool = true; // this is set dynamically and not known in advance
> while(true) {
> if($bool) { // this condition tested in every single loop
> // do first code
> } else {
> // do second code
> }
> }
> ?>
>
> and I am wondering if the compiler is smart enough to turn this into:
>
> <?
> $bool = true; // this is set dynamically and not known in advance
> if($bool) { // this condition only tested once
> while(true) {
> // do first code
> }
> } else {
> while(true) {
> // do second code
> }
> }
> ?>
>
> I realise this might be hard to follow without giving specific examples and
> code.
>
> In this case, the coding style of the 2nd example seems far better, but
> sometimes the 2 blocks of code are practically identical and it's a
> programmer's nightmare to have the blocks of code in 2 places and to
> remember to keep them both updated.
>
> I'm also assuming that using function calls is also much slower than
> evaluating a very simple IF statement.
>
> Thanks for your interest.
>
> Best wishes,
> Steve
>
> "David Grant" <david
grant.org.uk> schreef in bericht
> news:4395B271.4030303
grant.org.uk...
>> Jared Williams wrote:
>>> Why not
>>>
>>> for ($i = 0; $i < 1000000/100; ++$i)
>> This involves dividing 1000000 by 100 for each iteration of the loop.
>> It would be better to test against 10000.
>>
>> There is also the unwanted side-effect of executing the code on each
>> hundredth iteration, which is unwanted (as far as I understand the
>> problem). :)
>>
>> It would be interesting if Steve could divulge the greater problem that
>> he is seeking a solution to.
>>
>> Cheers,
>>
>> David
>> --
>> David Grant
>> http://www.grant.org.uk/
>
--
David Grant
http://www.grant.org.uk/
attached mail follows:
This is probably going to sound strange, but I like to try to think outside the box (buzzphrase!) and hit things at odd angles.
Would someone care to test (or already know) the performance difference between a "for" loop and a "foreach" loop?
Or the performance difference over many iterations of "if (something == somethingelse)" versus "if (true)"?
Two examples to test:
<?php
$arr = array_fill(0, 999999, 'echo \"test standard\";');
$arr[100] = 'echo \"test special\";';
foreach ($arr as $value) {
eval($value);
}
?>
or....
<?php
$arr = array_fill(0, 999999, true);
$arr[100] = false;
foreach ($arr as $value) {
if ($value) {
// do standard
} else {
// do special
}
}
?>
I'd be curious to see the benchmarks. I wonder if a "if()" versus doing the value check in a "for" statement are different speed-wise.. I'm wondering how much "eval()" slows it down.. and I'm wondering if "if (value == value2)" is slower than "if (true)".
Probably other offbeat ways of doing something like this too.
-TG
= = = Original message = = =
Hi everyone
Quick question:
If I have such a loop:
<?
for($i=0;$i<1000000;$i++)
if($i==100)
// do something special for this occurence
// do something standard
?>
In this case it seems such a waste that the if() statement is done 999999
times when it's not needed. Is there any obvious trick that I am missing?
I'm not sure how taxing a simple if() statement is on a server, maybe it's
negligible, or is it something to worry about?
Something which I'd prefer NOT to do:
<?
for($i=0;$i<100;$i++)
// do something standard
// do something special for $i = 100
for($i=101;$i<1000000;$i++)
// do something standard
?>
as I would have have to either keep two copies of the code or write a
function just for this purpose, which hardly seems worth it.
Thanks to anyone who takes the time to think about my question and/or
respond.
Best wishes,
Steve McGill
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
attached mail follows:
Is there a repository of php scripts that can communicate with
Windows Media Server
I am looking to do some load balancing with our 4 media servers in
San Jose, Washington, Dallas, London
Essentially, I need to get the number of current users on a
particular server.
If the server has over 200 users, go to another server.
Anyone done this with PHP specifically ?
g
attached mail follows:
Hi list
Does anyone of you know of a good forum that is easy to customize and supports
sticky notes, user registration, bb code and stuff like that?
With kind regards
Andy
--
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBDlbh/6Hylol726jIRAnXCAJ9jdO+edfzkgPg5up7NaynWDEhBBwCfRyGT
f2gqC+Oop5dxzybmNWghilc=
=vzfc
-----END PGP SIGNATURE-----
attached mail follows:
Andy Pieters wrote:
> Hi list
>
> Does anyone of you know of a good forum that is easy to customize and supports
> sticky notes, user registration, bb code and stuff like that?
I'm sure Google knows.
--
John C. Nichel IV
Programmer/System Admin (ワberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
[snip]
I'm sure Google knows.
[/snip]
Google knows everything....[refrain from putting some terse comment
concerning certain products which have caused me to curse so much that I
will only have coals & switches in my stocking this Christmas]
attached mail follows:
On Tuesday 06 December 2005 16:16, John Nichel wrote:
> Andy Pieters wrote:
> > Hi list
> >
> > Does anyone of you know of a good forum that is easy to customize and
> > supports sticky notes, user registration, bb code and stuff like that?
>
> I'm sure Google knows.
The difference with google and humans is that google doesn't know about
experience and stuff like that.
I did look at google but I wanted HUMAN opinions.
With kind regards
Andy
--
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBDlbue6Hylol726jIRAkZUAJ9YxVBFlqZEH+TUObpOTn7TWUXsAQCbBYtx
ysRnzK+rYrQxXvOV9SZsRYU=
=QsjN
-----END PGP SIGNATURE-----
attached mail follows:
On Tue, 2005-12-06 at 11:22, Jay Blanchard wrote:
> [snip]
> I'm sure Google knows.
> [/snip]
>
>
> Google knows everything....[refrain from putting some terse comment
> concerning certain products which have caused me to curse so much that I
> will only have coals & switches in my stocking this Christmas]
Maybe one of those switches will be back nix.
I know, I know, that wasn't very punny.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Jay Blanchard wrote:
> [snip]
> I'm sure Google knows.
> [/snip]
>
>
> Google knows everything....[refrain from putting some terse comment
> concerning certain products which have caused me to curse so much that I
> will only have coals & switches in my stocking this Christmas]
What concerns me is that you're wearing stockings. ;)
--
John C. Nichel IV
Programmer/System Admin (ワberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
>>> Does anyone of you know of a good forum that is easy to customize
>>> and
>>> supports sticky notes, user registration, bb code and stuff like
>>> that?
I would suggest that Phorum (www.phorum.org) and phpBB
(www.phpbb.com) are the two biggies (written in PHP). Both have all
these features plus many available mods.
Larry
attached mail follows:
Andy Pieters wrote:
> On Tuesday 06 December 2005 16:16, John Nichel wrote:
>
>>Andy Pieters wrote:
>>
>>>Hi list
>>>
>>>Does anyone of you know of a good forum that is easy to customize and
>>>supports sticky notes, user registration, bb code and stuff like that?
>>
>>I'm sure Google knows.
>
> The difference with google and humans is that google doesn't know about
> experience and stuff like that.
>
> I did look at google but I wanted HUMAN opinions.
Then look at sites like php.resourceindex.com where they have user
ratings and comments. A question like that on this list is only going
to get you personal preferences, and a mini-flame war about which
product sucks and which product rocks. (see the latest thread on IDE's;
although the flaming is non-existant...must be because of the holiday
season).
http://php.resourceindex.com/Complete_Scripts/Bulletin_Board_Message_Systems/
--
John C. Nichel IV
Programmer/System Admin (ワberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
Larry E. Ullman wrote:
>>>> Does anyone of you know of a good forum that is easy to customize and
>>>> supports sticky notes, user registration, bb code and stuff like that?
http://fudforum.org/features.php
I've heard lots about it, but never used it.
Cheers,
David Grant
--
David Grant
http://www.grant.org.uk/
attached mail follows:
On 12/6/05, Larry E. Ullman <LarryUllman
dmcinsights.com> wrote:
> >>> Does anyone of you know of a good forum that is easy to customize
> >>> and
> >>> supports sticky notes, user registration, bb code and stuff like
> >>> that?
>
> I would suggest that Phorum (www.phorum.org) and phpBB
> (www.phpbb.com) are the two biggies (written in PHP). Both have all
> these features plus many available mods.
>
> Larry
>
I second phpbb. You can see it on my forum at lyricslist:
http://lyricslist.com/forum
One big problem that I have had is with forum spam. Phpbb makes it
easy to control. I won't go into all the details, but you could
research that yourself easily enough. Or email me personally.
Dotan Cohen
http://technology-sleuth.com/long_answer/what_is_hdtv.html
attached mail follows:
On 12/6/05, Andy Pieters <mailings
vlaamse-kern.com> wrote:
> On Tuesday 06 December 2005 21:25, you boldly pressed keys on your keyboard to
> form this message:
> > One big problem that I have had is with forum spam. Phpbb makes it
> > easy to control. I won't go into all the details, but you could
> > research that yourself easily enough. Or email me personally.
>
> Hi Dotan
>
> I've looked at phpBB but I got a headache trying to figure out how to style
> and customize it.
>
> I've currently downloaded Phorum and started playing with it. Looks a lot
> easier then phpBB.
>
> Have you been able to customize phpBB at your heart's content, stylewyse that
> is?
>
> With kind regards
>
> Andy
>
Yes, I have. In the '/templates/subSilver' folder there are files
overall_header and overall_footer that you can customize and that
customizes each page. Those were the only files that I touched
(look-wise). I also added a few other mods that don't affect the look
of the forum. Email me if you get stuck.
Dotan
http://technology-sleuth.com/long_answer/why_are_internet_greeting_cards_dangerous.html
.
attached mail follows:
Ave,
Steve, I did a phpinfo() on my webhost and as it turns out, they are using a
CGI binary version, much to my surprise and dismay.
Anyhow... Do I have any alternatives for an http authentication kind of
authentication ?
Thanks,
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180
Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: rahul
informed-sources.com
http://www.informed-sources.com
On 12/6/05 9:50 AM, "Steve McGill" <steve
bluearena.com> wrote:
> Hi Rahul,
>
> Try doing a print_r($_SERVER) to see if the variables are being set.
>
> If they aren't, take a look at the phpinfo(); -> chances are your host is
> using a CGI binary version of PHP to use together with a security wrapper
> like suPHP or phpSuExec, which might throw away the variables that you
> require.
>
> Steve
>
> ""Rahul S. Johari"" <rjohari
nycap.rr.com> schreef in bericht
> news:BFBAFEC2.111E9%rjohari
nycap.rr.com...
>
> Ave,
>
> Iケm trying to run this very simple HTTP user authentication script:
>
> <?php
> if (!isset($_SERVER['PHP_AUTH_USER'])) {
> header('WWW-Authenticate: Basic realm="Private"');
> header('HTTP/1.0 401 Unauthorized');
> echo 'Unauthorized';
> exit;
> } else {
>
> if(($_SERVER['PHP_AUTH_USER']=="try") &&
> ($_SERVER['PHP_AUTH_PW']=="try")) {
> ?>
>
> <HTML>
> <HEAD></HEAD>
> <BODY>
> My Stuff Goes Here!
> </BODY>
> </HTML>
>
>
> <?
> }
> else {
> echo "Access Denied";
> }
> }
> ?>
>
> The problem is, this script runs perfectly fine on my localhost machine at
> home, however itケs not working on my web server (purchased webhosting). When
> I open this page on my web site, it does bring up the popup box asking for
> Username & Password ュ the problem is, even if I type the correct user/pass,
> it wonケt accept it. It keeps asking me for user/pass again and again and
> finally brings up the ウUnauthorizedイ text on the page.
>
> Why wonケt it allow the correct user/pass to login? I donケt understand.
>
> The only difference between the PHP on my localhost and the PHP on my
> webhost server is that my local machine is running PHP 5 and the webhost
> server is running PHP 4.4.1
attached mail follows:
If I have an array, such as
$Var[0] = "Dog";
$Var[1] = "Cat";
$Var[2] = "Horse";
Is there a way to quickly check to see if $Var contains "Lion" without
walking through each value?
attached mail follows:
[snip]
Is there a way to quickly check to see if $Var contains "Lion" without
walking through each value?
[/snip]
http://us3.php.net/in_array
attached mail follows:
On 6 Dec 2005, at 17:33, Ben Miller wrote:
> If I have an array, such as
>
> $Var[0] = "Dog";
> $Var[1] = "Cat";
> $Var[2] = "Horse";
>
> Is there a way to quickly check to see if $Var contains "Lion" without
> walking through each value?
Look in the manual at the function in_array()
Cheers,
Rich
--
http://www.corephp.co.uk
PHP Development Services
attached mail follows:
This what you want?
http://us3.php.net/manual/en/function.array-search.php
-TG
= = = Original message = = =
If I have an array, such as
$Var[0] = "Dog";
$Var[1] = "Cat";
$Var[2] = "Horse";
Is there a way to quickly check to see if $Var contains "Lion" without
walking through each value?
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
attached mail follows:
In this if statement, if the condition is true, then it will assign true
to the array (as I want it to). If the condition evaluates to false, it
assigns nothing. Any idea why it won't assign false? If I switch the
FALSE boolean value to the number 0, that will get assigned. Seems
kinda strange...
$this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] = ( (
!empty($_POST['vac_promo']) ) && ( $_POST['vac_promo'] == 'on' ) ) ?
TRUE : FALSE;
attached mail follows:
On Tuesday 06 December 2005 17:38, Gabe wrote:
> $this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] = ( (
> !empty($_POST['vac_promo']) ) && ( $_POST['vac_promo'] == 'on' ) ) ?
> TRUE : FALSE;
I have a habit of casting true or false to boolean so that I'm sure they're
not interpreted as 1 or 0.
Try this
$this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] = ( (
!empty($_POST['vac_promo']) ) && ( $_POST['vac_promo'] == 'on' ) ) ?
(bool) true:(bool) false;
HTH
Andy
--
Now listening to Whigfield - Saturday Night on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBDlgPH6Hylol726jIRArIjAJ9PazDx6XgWmcOu5p11554c65RrSACfSf7T
5bO6POb0N3ex1i4UdiIn1Xo=
=eYBR
-----END PGP SIGNATURE-----
attached mail follows:
On Tue, Dec 06, 2005 at 12:38:28PM -0500, Gabe wrote:
> In this if statement, if the condition is true, then it will assign true
> to the array (as I want it to). If the condition evaluates to false, it
> assigns nothing. Any idea why it won't assign false? If I switch the
> FALSE boolean value to the number 0, that will get assigned. Seems
> kinda strange...
>
> $this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] = ( (
> !empty($_POST['vac_promo']) ) && ( $_POST['vac_promo'] == 'on' ) ) ?
> TRUE : FALSE;
It only appears to be nothing, if you issue:
php -r "echo false;"
Nothing happens.
if you issue:
php -r "var_dump(false);"
You'll get bool(false)
Btw, your condition is doing extra work. Consider the output of:
php -r "var_dump(0 && 1);"
Outputs: bool(false)
So your condition to return true or false isn't really needed, a
simple:
$this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] =
( !empty($_POST['vac_promo']) && $_POST['vac_promo'] == 'on'; )
Will be exactly the same thing.
Also I would suggest changing empty() to isset(), so you would have
$this->m_arrQuesInfo[$this->m_itemID]['blnVacPromo'] =
( isset($_POST['vac_promo']) && $_POST['vac_promo'] == 'on'; )
empty() in this case doesn't really mean anything, the isset() will
prevent a E_NOTICE to happen.
HTH,
Curt.
--
cat .signature: No such file or directory
attached mail follows:
In case anyone encounters this problem - using the latest 4.4.x
snapshot fixed the problem for me (thanks, developers!).
Kristina
On 12/5/05, kristina clair <kclair
gmail.com> wrote:
> On 12/5/05, Jay Blanchard <jay.blanchard
thermon.com> wrote:
> > [snip]
> > I'm having a problem with certain SSI files which include php scripts
> > after upgrding php from 4.3.10 to 4.4.1.
> > The includes look like:
> > <!--#include file="eventsdb.php?ID=81&fld=2" -->
> >
> > In some cases, the page output is different with 4.4.1 than it is with
> > 4.3.10. In the worst cases, Apache gives a segmentation fault, and
> > the page is blank.
> >
> > Has anyone encountered any similar issues?
> > [/snip]
> >
> > We'd have to see some code to begin to analyse what the problem might be.
> > Can you send php code snips from eventdb.php?
> >
>
> The code is short. The same php script is being included in the page
> which is displaying differently and the page which is causing the
> apache segfault.
>
> if (empty($ID)){
> $ID='1';
> }
> $today = date("Ymd");
> $conn = mysql_connect ([snip]);
> if ($conn == false){
> echo mysql_errno() . ": " . mysql_error() . "<BR>";
> exit;
> }
> else {
> $rtn = mysql_select_db ("[tablename]");
> $sql = "select * from events where ID = ".$ID;
> $result = mysql_query ($sql);
> if ( ($row = mysql_fetch_row($result)) &&
> ($today<=$row[4]
> ) ){
> //if ( $row =
> mysql_fetch_
> row($result)) {
> switch ($fld){
> case 2:
> echo $row[2];
> break;
> case 5:
> echo $row[5];
> break;
> case 6:
> echo $row[6];
> break;
> case 7:
> echo $row[7];
> break;
> default:
> echo $row[1];
> break;
> }
> }
>
> }
>
>
> By the way, the backtrace from the apache segfault is:
> #0 0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0, h=0,
> pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1)
> at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390
> 390 p = ht->arBuckets[nIndex];
> (gdb) bt full
> #0 0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0, h=0,
> pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1)
> at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390
> nIndex = 0
> p = Variable "p" is not available.
> (gdb)
>
> That segfault backtrace is the same even if I compile php with the
> --without-zend-memory-manager flag, and also when I disable all Zend
> settings in php.ini.
>
> Thanks,
> Kristina
>
> --
> "In most cases, people, even wicked people, are far more naive and
> simple-hearted than one generally assumes. And so are we."
> /* last line, 1st ch., The Brothers Karamazov */
>
--
"In most cases, people, even wicked people, are far more naive and
simple-hearted than one generally assumes. And so are we."
/* last line, 1st ch., The Brothers Karamazov */
attached mail follows:
Sorry it took me so long, I wasn't sure where the problem lay and couldn't
get you the exact code, but I figured out why (sorta) this was happening.
// Causes only Safiri to bomb
header("location:
".$_SERVER['PHP_SELF']."?action=listentries&categoryid=".$id."&page=".$pagei
d);
exit;
Headers:
http://www.domain.org/page.php?action=subcategory&id=7&page=33
GET /page.php?action=subcategory&id=7&page=33 HTTP/1.1
Host: www.domain.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12)
Gecko/20050915 Firefox/1.0.7
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.domain.org/page.php?page=33
Cookie: PHPSESSID=cff99c9147d0741d6e48368f72951ef4
HTTP/1.x 302 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Content-Length: 188
Content-Type: text/html
Expires: Thu, 19 Nov 1981 08:52:00 GMT
// NOTE HERE NO PAGE REFERENCED
Location: ?action=listentries&categoryid=10&page=33
Server: Microsoft-IIS/6.0
X-Powered-By: PHP/4.4.0, ASP.NET
Date: Tue, 06 Dec 2005 19:01:00 GMT
// Doesn't cause Safari to bomb
header("location:
page.php?action=listentries&categoryid=".$id."&page=".$pageid);
exit;
Headers:
http://www.domain.org/page.php?action=subcategory&id=7&page=33
GET /page.php?action=subcategory&id=7&page=33 HTTP/1.1
Host: www.domain.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12)
Gecko/20050915 Firefox/1.0.7
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.domain.org/page.php?page=33
Cookie: PHPSESSID=cff99c9147d0741d6e48368f72951ef4
HTTP/1.x 302 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Content-Length: 188
Content-Type: text/html
Expires: Thu, 19 Nov 1981 08:52:00 GMT
// NOW ITS FINE
Location: page.php?action=listentries&categoryid=10&page=33
Server: Microsoft-IIS/6.0
X-Powered-By: PHP/4.4.0, ASP.NET
Date: Tue, 06 Dec 2005 19:01:00 GMT
Firefox and IE, I guess, "assume" where they are supposed to go, where as
Safari was just like "no idea" BOOM. So it seems to me that the browser or
the script has no idea what PHPSELF is untill the script finishes
executing... Input would be welcome.
-----Original Message-----
From: Brent Baisley [mailto:brent
landover.com]
Sent: Monday, December 05, 2005 12:15 PM
To: Mark Steudel
Cc: php-general
lists.php.net
Subject: Re: [PHP] Redirects Safari vs Others
Probably not a PHP problem. And probably can't help without seeing your
redirect code. I've never had a problem with redirects in any browser Safari
or otherwise, but I always make sure I redirect with a full URL rather than
a relative URL.
On Dec 5, 2005, at 1:29 PM, Mark Steudel wrote:
> I was wondering if folks have experienced infinite redirection loops
> with Safari where other browsers don't encounter the same problems.
>
> This is what safari spits out
>
> http://www.domain.com/microlibrary.php?action=subcategory&id=7&top=%
> 2Fpage.p
> hp%3Fpage%3D33&page=33?action=listentries&categoryid=7&top=/
> page.php?page=33
> &page=33?action=listentries&categoryid=7&top=/page.php?
> page=33&page=33?actio
> n=listentries&categoryid=7&top=/page.php?page=33&page=33?
> action=listentries&
> categoryid=7&top=/page.php?page=33&page=33?
> action=listentries&categoryid=7&t
> op=/page.php?page=33&page=33?action=listentries&categoryid=7&top=/
> page.php?p
> age=33&page=33?action=listentries&categoryid=7&top=/page.php?
> page=33&page=33
> ?action=listentries&categoryid=7&top=/page.php?page=33&page=33?
> action=listen
> tries&categoryid=7&top=/page.php?page=33&page=33?
> action=listentries&category
> id=7&top=/page.php?page=33&page=33?
> action=listentries&categoryid=7&top=/page
> .php?page=33&page=33?action=listentries&categoryid=7&top=/page.php?
> page=33&p
> age=33?action=listentries&categoryid=7&top=/page.php?
> page=33&page=33?action=
> listentries&categoryid=7&top=/page.php?page=33&page=33?
> action=listentries&ca
> tegoryid=7&top=/page.php?page=33&page=33?
> action=listentries&categoryid=7&top
> =/page.php?page=33&page=33
>
> I'm sure this is a coding problem on my part but it's interesting that
> it doesn't happen in firefox or IE.
>
> Thanks, Mark
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
On Dec 6, 2005, at 2:55 PM, Mark Steudel wrote:
> Sorry it took me so long, I wasn't sure where the problem lay and
> couldn't
> get you the exact code, but I figured out why (sorta) this was
> happening.
>
> // Causes only Safiri to bomb
> header("location:
> ".$_SERVER['PHP_SELF']."?action=listentries&categoryid=".
> $id."&page=".$pagei
> d);
> exit;
FWIW, I tried to duplicate this and wasn't able to. Here's a short
test script:
<?php
if ($_GET['action'])
echo "ok";
else
header("Location:".$_SERVER['PHP_SELF']."?action=list&cat=id");
?>
When I hit that page, it behaves as expected, redirects to the same
page with ?action.. and then it responds by printing 'ok'.
This is using PHP 4.3.10 and Safari v2.0.2 (416.13).
dan
Menegroth:~{0}% telnet dev.tangledhelix.com 80
Trying 205.196.219.129...
Connected to dev.tangledhelix.com.
Escape character is '^]'.
GET /php_self/ HTTP/1.1
Host: dev.tangledhelix.com
HTTP/1.1 302
Date: Tue, 06 Dec 2005 20:15:53 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/
1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.10
Location: /php_self/index.php?action=list&cat=id
Transfer-Encoding: chunked
Content-Type: text/html
0
GET /php_self/index.php?action=list&cat=id HTTP/1.1
Host: dev.tangledhelix.com
HTTP/1.1 200 OK
Date: Tue, 06 Dec 2005 20:16:10 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/
1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.10
Transfer-Encoding: chunked
Content-Type: text/html
X-Pad: avoid browser bug
2
ok
0
--
To announce that there must be no criticism of the President, or that
we are to stand by the President, right or wrong, is not only
unpatriotic and servile, but is morally treasonable to the American
public. -Theodore Roosevelt, 1918
attached mail follows:
[snip]
// Causes only Safiri to bomb
header("location:
".$_SERVER['PHP_SELF']."?action=listentries&categoryid=".$id."&page=".$pagei
d);
exit;
[/snip]
Since PHP is processed server-side it has to be the URL causing Safari to
bail. Have you echo'd out the URL to see what it is composed of?
$foo =
$_SERVER['PHP_SELF']."?action=listentries&categoryid=".$id."&page=".$pageid;
echo $foo;
attached mail follows:
You are right, thank you for trying it out and letting me know. I went back
and tested this again and it all worked. I then checked out my code where it
didn't work and I had moved a single quote outside of the brackets,
$_SERVER['PHP_SELF]' ... Oops.
-----Original Message-----
From: Dan Lowe [mailto:dan
tangledhelix.com]
Sent: Tuesday, December 06, 2005 12:17 PM
To: Mark Steudel
Cc: PHP General List
Subject: Re: [PHP] Redirects Safari vs Others
On Dec 6, 2005, at 2:55 PM, Mark Steudel wrote:
> Sorry it took me so long, I wasn't sure where the problem lay and
> couldn't get you the exact code, but I figured out why (sorta) this
> was happening.
>
> // Causes only Safiri to bomb
> header("location:
> ".$_SERVER['PHP_SELF']."?action=listentries&categoryid=".
> $id."&page=".$pagei
> d);
> exit;
FWIW, I tried to duplicate this and wasn't able to. Here's a short test
script:
<?php
if ($_GET['action'])
echo "ok";
else
header("Location:".$_SERVER['PHP_SELF']."?action=list&cat=id");
?>
When I hit that page, it behaves as expected, redirects to the same page
with ?action.. and then it responds by printing 'ok'.
This is using PHP 4.3.10 and Safari v2.0.2 (416.13).
dan
Menegroth:~{0}% telnet dev.tangledhelix.com 80 Trying 205.196.219.129...
Connected to dev.tangledhelix.com.
Escape character is '^]'.
GET /php_self/ HTTP/1.1
Host: dev.tangledhelix.com
HTTP/1.1 302
Date: Tue, 06 Dec 2005 20:15:53 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a
PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.10
Location: /php_self/index.php?action=list&cat=id
Transfer-Encoding: chunked
Content-Type: text/html
0
GET /php_self/index.php?action=list&cat=id HTTP/1.1
Host: dev.tangledhelix.com
HTTP/1.1 200 OK
Date: Tue, 06 Dec 2005 20:16:10 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a
PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.10
Transfer-Encoding: chunked
Content-Type: text/html
X-Pad: avoid browser bug
2
ok
0
--
To announce that there must be no criticism of the President, or that we are
to stand by the President, right or wrong, is not only unpatriotic and
servile, but is morally treasonable to the American
public. -Theodore Roosevelt, 1918
attached mail follows:
Lets say I have the following:
Current URL: http://www.domain.com/page.php?action=list
<http://www.domain.com/page.php?action=list&top=/page.php?action=list&id=3>
&top=/page.php?action=list&id=3
$top = $_SERVER['PHP_SELF'].'?'.$_SERVER['argv']['0']
Now I want to create a URL with a return link in it
<a href="'.$_SERVER['PHP_SELF'].'?action=add&return='.$top.'"> Add
Something </a>
Should I use htmlentites on $top first?
Second let's say instead of constructing a link I want to use a header and
redirect someone
header("location: page.php?action=add&return=".$top );
So do I use urlencode here?
Lets say I have something that has been htmlentitied, and I want to use a
header command, do I htmlentitydecode and then urlencode?
attached mail follows:
> Should I use htmlentites on $top first?
AFAIK, all of what you said is correct except for that, where you
should use htmlentities(urlencode($top)).
attached mail follows:
On Tue, Dec 06, 2005 at 12:05:10PM -0800, Mark Steudel wrote:
> Lets say I have the following:
Before I go further:
htmlentities - escapes the output for html
urlencode - escapes the output for a url
>
> Current URL: http://www.domain.com/page.php?action=list
> <http://www.domain.com/page.php?action=list&top=/page.php?action=list&id=3>
> &top=/page.php?action=list&id=3
>
> $top = $_SERVER['PHP_SELF'].'?'.$_SERVER['argv']['0']
- Be careful when using PHP_SELF, probably not a factor here but
consider if someone requested /page.php/foobar?action....
PHP_SELF will be 'page.php/foobar
- $_REQUEST['argv']... well there isn't any such requested
variabled.
>
> Now I want to create a URL with a return link in it
>
> <a href="'.$_SERVER['PHP_SELF'].'?action=add&return='.$top.'"> Add
> Something </a>
>
> Should I use htmlentites on $top first?
no.. your are defining a url paremeter, so you should escape for a url
>
> Second let's say instead of constructing a link I want to use a header and
> redirect someone
>
> header("location: page.php?action=add&return=".$top );
>
> So do I use urlencode here?
yes, cause your are defining a url parameter.
>
> Lets say I have something that has been htmlentitied, and I want to use a
> header command, do I htmlentitydecode and then urlencode?
Lets say i open a bottle of wine for someone, should I take the
first sip and say yes this is a good wine or not, or let them taste
and decide.
I wonder this cause, well, i wonder why the url has anything to do
with htmlentities, cause it doesn't.. all it needs to know is that
what it is sending is ok (urlencoded). The url doesn't care what the
application did prior to sending the data.
Hopefully to explain my first thoughts:
1. htmlentities should only be applied when outputing data that
will be interpreted as html.
ie: echoing to the browser.
2. urlencode should be used when outputing data that will be
interpreted within a url.
ie: making an href or header('Location: ') call, in otherwords
defining data being sent via http.
HTH,
Curt.
--
cat .signature: No such file or directory
attached mail follows:
Hi,
Does anyone have stats in terms of migration from 4 to 5, specifically I'd
like to know if the bulk of PHP developers have begun to change-over. I am
(was) a Java developer, but have been doing freelance/consultant work in PHP
for two years and am still developing on PHP4 platform. I remember when PHP4
was introduced (while I was still in college), and I made the transition to
it immediately, but I have refrained from doing so for 5, since most
development gigs are still working with 4. Basically I am wondering if it
would be advantageous to make the switch; on another note, with PHP5's
"stronger" OO model, I am considering moving from page-centric to an MVC
model, but it seems there are a million MVC frameworks available and haven't
had any experience with them. Comments?
Christian
attached mail follows:
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 an object model to represent db objects, and I am
bulk-loading the objects via some PHP scripts. Sadly the scripts
consume unbounded memory because of this problem.
I have done a lot of programming in C++ and Obj-C and the normal way
to handle circular references is to have parents "retain" (keep ref-
counted links) to their kids, and have the kids have "weak
references" (non-ref-counted) links to their parents. This way, when
the parent is no longer used, it will automatically 0-out the ref
counts to all children it links too and things GC correctly.
Now, how to do this in PHP?
Well, there are no "documented" weak references. However, I figured
out by trial that if you obtain a php-reference to an object, it
doesn't bump the refcount.
Question #1: Is the fact that references to objects in the form
$objRef = &$obj don't bump the refcount of $obj an intended behavior
that can be counted on? If so, cool!
So, now that we have a way to do weak references, we should be able
to implement a reasonable memory management scheme for parent-child
objects.
Normally from the client side the interface should look something like:
$parent = new Parent();
$child = new Child();
$parent->addChild($child);
Where parent can have 0,n children and child can have 0,1 parent.
And all of parent's internal links to child should be refcounted, and
the internal links from child to parent are weak (not ref-counted).
So based on the above discovery about references, I tried to
implement this as such:
class Parent
{
public $children = array();
// add a child to our list. We want a ref-counted link here.
function addChild($child)
{
$this->children[] = $child; // refCounted desired in
parent->child link
$child->setParent($this);
}
}
class Child
{
public $parent;
// set the parent object. We want a non-ref-counted link here.
function setParent(&$parent)
{
// refCount NOT desired in child->parent link
$this->parent = &$parent;
}
}
Now, you'd expect this would work, but it doesn't. On a hunch, I
changed the client code to:
$parent = new Parent();
$child = new Child();
$parent->addChild($child);
$child->setParent($child); // new line here - you can successfully
create a reference to the object when not passed in as $this
Now, this works! However, it's not practical. The setParent call
should work from within the parent object....
So what I figured out is that $this is a "pseudo variable" according
to the docs, but I don't know what that means. Empirically I have
figured out that it means you cannot create a reference to it.
Is this a feature or a bug? What's the workaround?
This is a serious problem for PHP scripts that need to do things that
require large amounts of memory.
Please advise.
Thanks,
Alan
attached mail follows:
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 you took out the pass-by-reference and instead pass-by-value
for the addParent() method. Then again, that doesn't particularly sound
correct either.
This link might help. They cover a lot of advanced reference usage for PHP.
http://www.onlamp.com/pub/a/php/2002/09/12/php_foundations.html
Alan Pinstein wrote:
> 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 an object model to represent db objects, and I am
> bulk-loading the objects via some PHP scripts. Sadly the scripts
> consume unbounded memory because of this problem.
>
> I have done a lot of programming in C++ and Obj-C and the normal way
> to handle circular references is to have parents "retain" (keep ref-
> counted links) to their kids, and have the kids have "weak
> references" (non-ref-counted) links to their parents. This way, when
> the parent is no longer used, it will automatically 0-out the ref
> counts to all children it links too and things GC correctly.
>
> Now, how to do this in PHP?
>
> Well, there are no "documented" weak references. However, I figured
> out by trial that if you obtain a php-reference to an object, it
> doesn't bump the refcount.
>
> Question #1: Is the fact that references to objects in the form
> $objRef = &$obj don't bump the refcount of $obj an intended behavior
> that can be counted on? If so, cool!
>
> So, now that we have a way to do weak references, we should be able
> to implement a reasonable memory management scheme for parent-child
> objects.
>
> Normally from the client side the interface should look something like:
>
> $parent = new Parent();
> $child = new Child();
> $parent->addChild($child);
>
> Where parent can have 0,n children and child can have 0,1 parent.
>
> And all of parent's internal links to child should be refcounted, and
> the internal links from child to parent are weak (not ref-counted).
>
> So based on the above discovery about references, I tried to
> implement this as such:
>
> class Parent
> {
> public $children = array();
>
> // add a child to our list. We want a ref-counted link here.
> function addChild($child)
> {
> $this->children[] = $child; // refCounted desired in
> parent->child link
> $child->setParent($this);
> }
> }
>
> class Child
> {
> public $parent;
>
> // set the parent object. We want a non-ref-counted link here.
> function setParent(&$parent)
> {
> // refCount NOT desired in child->parent link
> $this->parent = &$parent;
> }
> }
>
> Now, you'd expect this would work, but it doesn't. On a hunch, I
> changed the client code to:
>
> $parent = new Parent();
> $child = new Child();
> $parent->addChild($child);
> $child->setParent($child); // new line here - you can
> successfully create a reference to the object when not passed in as
> $this
>
> Now, this works! However, it's not practical. The setParent call
> should work from within the parent object....
>
> So what I figured out is that $this is a "pseudo variable" according
> to the docs, but I don't know what that means. Empirically I have
> figured out that it means you cannot create a reference to it.
>
> Is this a feature or a bug? What's the workaround?
>
> This is a serious problem for PHP scripts that need to do things that
> require large amounts of memory.
>
> Please advise.
>
> Thanks,
> Alan
>
attached mail follows:
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) {
$this->val = $v;
}
}
In PHP5:
$o = new Object(2);
$b = $o;
$b->val = 3;
print $o->val; // echos 3
in PHP4 (assuming var is used instead of public)
$o = new Object(2);
$b = $o;
$b->val = 3;
print $o->val; // echos 2
This is cause objects in php5 exist all on there own, that get
referenced to a php variable.
On Tue, Dec 06, 2005 at 05:23:45PM -0500, Alan Pinstein wrote:
>
> Question #1: Is the fact that references to objects in the form
> $objRef = &$obj don't bump the refcount of $obj an intended behavior
> that can be counted on? If so, cool!
>
> So, now that we have a way to do weak references, we should be able
> to implement a reasonable memory management scheme for parent-child
> objects.
>
> Normally from the client side the interface should look something like:
>
> $parent = new Parent();
> $child = new Child();
> $parent->addChild($child);
Ok, i get to the code and well what I mentioned above explains why there is no
need to use the $o = &$object;
If I take your code and run it against one of the latest version's
of php 5.1 i will get a var_dump($child) of:
object(pChild)#2 (1) {
["parent"]=>
object(pParent)#1 (1) {
["children"]=>
array(1) {
[0]=>
object(pChild)#2 (1) {
["parent"]=>
object(pParent)#1 (1) {
["children"]=>
array(1) {
[0]=>
*RECURSION*
}
}
}
}
}
}
Which is what I see as expected results.
Curt.
--
cat .signature: No such file or directory
attached mail follows:
Hi all,
ok, I'm trying to write a script to optimize images for the web, but I
can't seem to figure out how to go about reducing the color pallete, and
therefor reducing the size of the images.
I'm trying to be generic about it so that users can optimize GIF's and
JPG's or even PNG's. I can't find much in the way of code on the net
about doing this...
Does anyone have any suggestions as to maybe some freely available
scripts or classes that can help me figure this out ???
Thanks,
Tim.
attached mail follows:
Tim Traver wrote:
> Hi all,
>
> ok, I'm trying to write a script to optimize images for the web, but I
> can't seem to figure out how to go about reducing the color pallete,
> and therefor reducing the size of the images.
>
> I'm trying to be generic about it so that users can optimize GIF's and
> JPG's or even PNG's. I can't find much in the way of code on the net
> about doing this...
>
> Does anyone have any suggestions as to maybe some freely available
> scripts or classes that can help me figure this out ???
>
> Thanks,
>
> Tim.
>
If you're working from a Linux box, do some studying on imagemagik. It
has scads of tools and uses one of the best optimization algorythms I've
seen. A very powerful tool.. can do low res, watermarks, resizing.. and
on and on and on.
John Hinton
attached mail follows:
Hi!
I need a web calendar and online diary application.
Can some one develop those applications for me.
You may use open source applications, or already developed applications in
your previous projects, I need simplest calendar and online diary
applications.
And ofcourse, I will pay you.
thank you!
Vikram!
attached mail follows:
Vikram Kumar wrote:
> Hi!
>
> I need a web calendar and online diary application.
Try this, it might fit your needs.
http://www.k5n.us/webcalendar.php
attached mail follows:
Anyone out there running debuggers and profilers on your windows boxes? I'd
like to start profiling some of my code and use some debuggers. Since we
have dev sites on the same box with product sites, I wanted to make sure
that before I ask our Sysadmin to install anything that they are stable and
easy to install. Any suggetsions out there? Ones that I have run across,
xdebug, DBG, Advanced PHP Debugger.
Thanks, Mark
attached mail follows:
Hello,
I want to learn about classes and objects in PHP.
(IMHO) I would say that my understanding of functions is very good.
Any books that you could suggest that specifically address just
classes/objects?
How-a-bout sites/links/tutorials on the web?
I am hoping that by learning how to use classes/objects in PHP I can
streamline how I code.
Thanks in advance!
Cheers,
Micky
--
ク.キエッ`キ.クク><(((コ>`キ.クク.キエッ`キ.クク><((((コ>
キエッ`キ.クク.キエッ`キ.クク.キエッ`キ.クク.キエッ`キ.クク><((((コ>
`キ.クク><((((コ>ク.キエッ`キ.クク><((((コ>
attached mail follows:
Michael Hulse wrote:
> Any books that you could suggest that specifically address just
> classes/objects?
Adam Trachtenberg's Upgrading to PHP 5 (O'Reilly) is a good book. It
covers all of the new features in PHP 5 (so it's not just OOP, sorry),
but the chapter on objects is excellent.
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/
attached mail follows:
On Dec 6, 2005, at 6:39 PM, Chris Shiflett wrote:
> Adam Trachtenberg's Upgrading to PHP 5 (O'Reilly) is a good book. It
> covers all of the new features in PHP 5 (so it's not just OOP, sorry),
> but the chapter on objects is excellent.
Hi Chris, thanks for the quick response. :) That book sounds good to
me... O'Reilly books always give me the most bang for my buck.
Thanks! :)
Cheers,
Micky
attached mail follows:
I took a look at a lot of books at Barnes and Noble and this I thought was
the best intro to classes. I think it does a good job of letting you know
both how to do things in HP4 and 5.
Professional PHP 5
Publisher: Wrox
-----Original Message-----
From: Michael Hulse [mailto:micky
ambiguism.com]
Sent: Tuesday, December 06, 2005 6:37 PM
To: php-general
lists.php.net
Subject: [PHP] Classes/Objects - Books/Links?
Hello,
I want to learn about classes and objects in PHP.
(IMHO) I would say that my understanding of functions is very good.
Any books that you could suggest that specifically address just
classes/objects?
How-a-bout sites/links/tutorials on the web?
I am hoping that by learning how to use classes/objects in PHP I can
streamline how I code.
Thanks in advance!
Cheers,
Micky
--
ク.キエッ`キ.クク><(((コ>`キ.クク.キエッ`キ.クク><((((コ>
キエッ`キ.クク.キエッ`キ.クク.キエッ`キ.クク.キエッ`キ.クク><((((コ>
`キ.クク><((((コ>ク.キエッ`キ.クク><((((コ>
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
Hi,
$writer = new XmlWriter();
...
$writer->writeDtd('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
produces no whitespace between the public & system ids like...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Has anyone got a workaround for this problem?
Jared
attached mail follows:
レデイコミが今、奥様の間で大ブレイク!
http://zhende-ma.com/1292/
問
xiaomenkaixingfulai
YAhoo.com.cn
10:51:00
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]