Hi,
I'm trying to decipher inherited code (I did not write this) and I'm
having great difficulty understanding the override of a method in PHP4
vs PHP5
Here's the code:
form.php
22 class FormClass
23 {
...
/* some method calls to _dispatchSave() */
572
My apologies. I've not seen something I should have earlier. Also the
instance that is behind all of this is and instance of
ActiveRecordFormClass.
So, in PHP4, the correct overridden method is called:
ActiveRecordFormClass::_dispatchSave().
In PHP5, the FormClass::_dispatchSave() is called...???
It's funny how talking or writing about something uncovers things you
didn't see before.
In an effort to tidy up the code I heeded the original implementors
comments and made the methods private (they were previously undeclared).
Making them public seems to have fixed the problem.
On 17/03/11
On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote:
It's unfortunate that PHP5 decided to throw a Strict Standards exception
when you include both style constructors. For instance, I'm certain at
one point the following was recommended:
?php
class Foo
{
function __construct()
On Wed, 2008-07-30 at 01:16 -0500, Larry Garfield wrote:
On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote:
It's unfortunate that PHP5 decided to throw a Strict Standards exception
when you include both style constructors. For instance, I'm certain at
one point the following was
[EMAIL PROTECTED] wrote:
Since the Players method is a constructor, it's more about how you set
the object(s) up.
What does the loop look like before you create a new object?
Well see here is where it gets messy! This is not my code - I've ported a
phpnuke module over to dragonflycms.
Since the Players method is a constructor, it's more about how you set
the object(s) up.
What does the loop look like before you create a new object?
Well see here is where it gets messy! This is not my code - I've ported a
phpnuke module over to dragonflycms.
The $players object is
The $players object is created before the loop:
$players = new Players($lid);
snip
Which means the code is only executed once since it's in the
constructor. It's not changing per loop because you're not calling the
code.
Maybe setting $this-max should be done in
fetchSelectData
Maybe setting $this-max should be done in
fetchSelectData
since that's what is causing/creating your loop.
Thanks Chris, I copied the code into the fetchSelectData function and it
seems to be working fine now!
Just need to test removing the code from the constructor to make sure its
still
[EMAIL PROTECTED] wrote:
The $players object is created before the loop:
$players = new Players($lid);
snip
Which means the code is only executed once since it's in the
constructor. It's not changing per loop because you're not calling the
code.
Maybe setting $this-max should be done in
[EMAIL PROTECTED] wrote:
Maybe setting $this-max should be done in
fetchSelectData
since that's what is causing/creating your loop.
Thanks Chris, I copied the code into the fetchSelectData function and it
seems to be working fine now!
Just need to test removing the code from the constructor
Don't forget that in PHP5, the constructor named has changed. In PHP4
it called a method with the same name as the class. But, in PHP5, it
looks for __construct() instead.
If __construct doesn't exist then it falls back to the php4 way - makes
it backwards compatible :)
--
Postgresql php
Chris wrote:
Don't forget that in PHP5, the constructor named has changed. In PHP4
it called a method with the same name as the class. But, in PHP5, it
looks for __construct() instead.
If __construct doesn't exist then it falls back to the php4 way - makes
it backwards compatible :)
But,
On Tue, 2008-07-29 at 22:26 -0700, Jim Lucas wrote:
Chris wrote:
Don't forget that in PHP5, the constructor named has changed. In PHP4
it called a method with the same name as the class. But, in PHP5, it
looks for __construct() instead.
If __construct doesn't exist then it falls back
I have the following code in part of a loop:
$max = $players-max();
Important parts of players class:
class Players extends dynamicTable {
var $setup;
var $lid;
var $size;
var $max;
var $data;
var $data_result;
var $data_index;
var $player_stats_result;
var
I have run through the script with a debugger, and sure
enough, we only enter function Players once.
Is this normal behaviour for PHP5 vs PHP4?
Is there a way for me to force $this-max to be calculated each time
function max is called?
Since the Players method is a constructor, it's more
Bob Fisher wrote:
I am running a hybrid environment.
Box A: PHP 4.3.9
Box B: PHP 5.1.6
Box C: Memcached 1.2.2
When I set a key in memcache(Box C) from Box A, I am unable to read
it from Box B and vice versa.
I did not see any such issues mentioned in the PHP documentation.
Has anyone seen
I am running a hybrid environment.
Box A: PHP 4.3.9
Box B: PHP 5.1.6
Box C: Memcached 1.2.2
When I set a key in memcache(Box C) from Box A, I am unable to read
it from Box B and vice versa.
I did not see any such issues mentioned in the PHP documentation.
Has anyone seen something similar?
Stut wrote:
Just wanted to pick you up on this. PHP is the only language you've
listed that only has a single implementation. There are implementations
of C++ compilers that are writting in other languages. I can't speak for
Java since I have little experience but I'd be surprised if all
Nathan Nobbe wrote:
look at C++, Java, and PHP. these languages are all written in C;
Just wanted to pick you up on this. PHP is the only language you've
listed that only has a single implementation. There are implementations
of C++ compilers that are writting in other languages. I can't
On Fri, August 24, 2007 10:11 am, Steve Brown wrote:
html
head
titlePHP Web Server Test/title
/head
body
?php phpinfo(); ?
/body
/html
phpinfo(), which should never be called in a production setting, is
quite possibly the worst benchmark function you could choose. :-) :-)
:-)
I ran
On Sat, August 25, 2007 9:45 am, Robert Cummings wrote:
PHP4 AND PHP5 developers don't even use OOP. Tell me what is
compelling
in PHP5 that doesn't rely on you being an OOP developer?
The XML stuff, if you need to parse XML a lot, which is not exactly a
niche market, but not everybody needs
On Sat, August 25, 2007 11:56 am, Nathan Nobbe wrote:
so we would really have to
dig deeper for a definition of 'basic oop' / 'true oop' etc.
I'll consider PHP true OOP when PECL has a Lisp extension for me to
write REAL oop code
:-)
Actually, that could be a kind of fun extension to write...
i dont know Robert; i think it depends upon the structure of ones business.
for instance; i work for a company full time, and have a start up of my own.
in both of those situations there is no impact on the client in the act of
eliminating php4 from the product implementation. the clients never
On Sat, 2007-08-25 at 09:38 -0400, Nathan Nobbe wrote:
i dont know Robert; i think it depends upon the structure of ones
business.
for instance; i work for a company full time, and have a start up of
my own.
in both of those situations there is no impact on the client in the
act of
yes, i agree, people wont be all-of-a-sudden ignoring php4, but the
notice on php.net says to migrate apps to 5 through the rest of the yaer.
id say thats ample time to move away from it.
pretty much all of my applications rely on php5 features except those
where the system was running on php4
On Sat, 2007-08-25 at 10:33 -0400, Nathan Nobbe wrote:
yes, i agree, people wont be all-of-a-sudden ignoring php4, but the
notice on php.net says to migrate apps to 5 through the rest of the
yaer. id say thats ample time to move away from it.
Migrate doesn't necessarily mean ditching PHP4
Robert,
C is a low-level language whereas php is a high level language.
ill admit it openly, i am biased toward oop / design patterns.
and i think what i boils down to is what you view as 'icing'
i view as 'bread-and-butter' ;)
personally i shudder when i see a big pile of usntructured code, or
On Sat, 2007-08-25 at 10:57 -0400, Nathan Nobbe wrote:
Robert,
C is a low-level language whereas php is a high level language.
ill admit it openly, i am biased toward oop / design patterns.
and i think what i boils down to is what you view as 'icing'
i view as 'bread-and-butter' ;)
I've
agreed :)
On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Sat, 2007-08-25 at 10:57 -0400, Nathan Nobbe wrote:
Robert,
C is a low-level language whereas php is a high level language.
ill admit it openly, i am biased toward oop / design patterns.
and i think what i boils down to
On Saturday 25 August 2007, Robert Cummings wrote:
Rewriting? You're assuming developers of PHP4 are using all of the
features in PHP5 but written using PHP4 code. That's not a very valid
assumption. You're also assuming they didn't already have code written
in PHP4 that was then duplicated b
On Sat, 2007-08-25 at 11:09 -0500, Larry Garfield wrote:
On Saturday 25 August 2007, Robert Cummings wrote:
Rewriting? You're assuming developers of PHP4 are using all of the
features in PHP5 but written using PHP4 code. That's not a very valid
assumption. You're also assuming they didn't
i know this thread started off about a performance comparison, but it is
already grown into much more.
suffice it to say that i consider the oop capacity of php4 nothing more than
a stepping stone on the way
to php5. i dont know of all the oop languages out there. mostly i have
worked w/ c++ and
Robert and everyone: PLEASE do not reply to list AND the sender, at least not
when I'm the sender. I don't need double copies of every message in every
thread I participate in. Thanks.
On Saturday 25 August 2007, Robert Cummings wrote:
There is no way to respond to the above request,
On Sat, 2007-08-25 at 12:28 -0500, Larry Garfield wrote:
Robert and everyone: PLEASE do not reply to list AND the sender, at least not
when I'm the sender. I don't need double copies of every message in every
thread I participate in. Thanks.
Sorry I've been hitting reply-all since I first
i dont know what all this goPHP5 stuff is about.
all i know is there was an announcment on php.net a few weeks back saying
php4 is deprecated and it soon will be made obsolete.
-nathan
On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Sat, 2007-08-25 at 12:28 -0500, Larry Garfield wrote:
On Saturday 25 August 2007, Nathan Nobbe wrote:
i dont know what all this goPHP5 stuff is about.
all i know is there was an announcment on php.net a few weeks back saying
php4 is deprecated and it soon will be made obsolete.
-nathan
That announcement came a week after this site launched:
On Sat, 2007-08-25 at 14:26 -0500, Larry Garfield wrote:
On Saturday 25 August 2007, Nathan Nobbe wrote:
i dont know what all this goPHP5 stuff is about.
all i know is there was an announcment on php.net a few weeks back saying
php4 is deprecated and it soon will be made obsolete.
Recently, I've been doing a lot of benchmarking with Apache to compare
different OSes and platforms. I did a stock install of Ubuntu 7.04
Server w/ Apache2 and PHP5. To do the test, I used ab to fetch the
following document:
html
head
titlePHP Web Server Test/title
/head
body
?php phpinfo(); ?
what are the changes that supposedly make php5 faster than php4?
when java went from the 1.4 series to the 5 series it became much faster.
this is because of enhancements to the jitter mechanism for sure. i dont
know what else they changed, but i know that had a great impact on the
performance.
PHP5 being faster than PHP4 is greatly dependent on what features you
use. I've consistently found PHP4 to be faster for my purposes also.
Cheers,
Rob.
On Fri, 2007-08-24 at 11:38 -0400, Nathan Nobbe wrote:
what are the changes that supposedly make php5 faster than php4?
when java went from
On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:
The only difference I can figure is that PHP5 was the packaged version
that comes with Ubuntu and I had to compile PHP4 from source since
there is no package for it in Feisty. But I wouldn't expect a 50%
increase as a result of that. Any
On Fri, 2007-08-24 at 12:24 -0500, Greg Donald wrote:
On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:
The only difference I can figure is that PHP5 was the packaged version
that comes with Ubuntu and I had to compile PHP4 from source since
there is no package for it in Feisty. But I
Greg Donald wrote:
On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:
The only difference I can figure is that PHP5 was the packaged version
that comes with Ubuntu and I had to compile PHP4 from source since
there is no package for it in Feisty. But I wouldn't expect a 50%
increase as a result of
On Friday 24 August 2007, Lester Caine wrote:
What would be interesting is if a group picked up PHP4 and kept going
with it in spite of the end of life announcement a few weeks back. I
wonder if the PHP license would allow such a thing. How open is it
exactly?
The PROBLEM is that
On Sat, 2007-08-25 at 00:28 -0500, Larry Garfield wrote:
On Friday 24 August 2007, Lester Caine wrote:
What would be interesting is if a group picked up PHP4 and kept going
with it in spite of the end of life announcement a few weeks back. I
wonder if the PHP license would allow such a
Fernando Cosso wrote:
Hi
I know this topic has to be discussed several times but I have a
situation I
need some advices.
I am working in a small company. The company does everything you need.
Computer service, sell computers, install servers, web page, etc. I am in
the web department. The
Travis Doherty wrote:
What about the argument that PHP4 is dead. It's done. It's over.
There is no reason anyone should be using it, less perhaps a lack of
time to tweak scripts for an upgrade from 4 to 5. Even if that is the
case, get to work :p
Support for PHP 4 will be dropped at
Myron Turner wrote:
Travis Doherty wrote:
What about the argument that PHP4 is dead. It's done. It's over.
There is no reason anyone should be using it, less perhaps a lack of
time to tweak scripts for an upgrade from 4 to 5. Even if that is the
case, get to work :p
Support for
Hello all,
I've been poking around a little bit, and I haven't found a good link for
showing the performance differences between the two versions of PHP. Mostly
I was just curious what the numbers were. I've heard some conflicting
opinions on the matter, and wanted to clear it up with some
Hey there... I am setting up a new test server for one of my
clients to
use, and I am curious if there is a reason to go with php4.xx
over php5.xx,
or the other way around. I would think that I would want to
go with the
newest one, but my client requested that 4.xx be installed.
, 2006 1:18 PM
To: php-general@lists.php.net; php-install@lists.php.net
Subject: [PHP] php4 vs. php5
Hey there... I am setting up a new test server for one of my clients to
use, and I am curious if there is a reason to go with php4.xx over
php5.xx,
or the other way around. I would think that I
On Thu, February 2, 2006 1:18 pm, Grae Wolfe - PHP wrote:
Hey there... I am setting up a new test server for one of my clients
to
use, and I am curious if there is a reason to go with php4.xx over
php5.xx,
or the other way around. I would think that I would want to go with
the
newest one,
This one time, at band camp, Gerry Danen [EMAIL PROTECTED] wrote:
I'm wondering if $_SERVER['HTTP_REFERER'] is no longer supported, or perhaps
has a new name?
still there, same name.
print_r($_SERVER);
Kevin
--
Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty
Kevin,
[client 192.168.0.2] PHP Notice: Undefined index: HTTP_REFERER in
/home/arls_lilies_test/html/include_db/db_connect.php on line 67
is what shows in the error log...
The actual code is
$glb_http_ref = $_SERVER['HTTP_REFERER'];
Gerry
On 1/7/06, Kevin Waterson [EMAIL PROTECTED]
On 1/7/06, Kevin Waterson [EMAIL PROTECTED] wrote:
This one time, at band camp, Gerry Danen [EMAIL PROTECTED] wrote:
I'm wondering if $_SERVER['HTTP_REFERER'] is no longer supported, or
perhaps
has a new name?
still there, same name.
print_r($_SERVER);
Ah, yes. It's there when the
A simplified version of this would be:
$glb_http_ref = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER']
: ;
or just:
$glb_http_ref = @$_SERVER['HTTP_REFERER'];
The latter will suppress the error message and return a null (or a blank as
far as PHP is concerned. Not the cleanest route
I'm wondering if $_SERVER['HTTP_REFERER'] is no longer supported, or perhaps
has a new name?
TIA
Gerry
I ran a test on the same machine for php4(port
80)vs. php5(port 8080).
Using the exact same code, I created 50
objects. It took twice as long in php5 as it did in the older php4.
I then ran a test to access a property of the class
using a method of the class. Again, php5 was almost
Richard,
On Tue, 2004-02-17 at 19:25, Richard Gintz wrote:
Using the exact same code, I created 50 objects. It took twice as
long in php5 as it did in the older php4.
From what I remember the speed improvement with objects in PHP 5 was
that they would be passed by reference, which I
hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed differences between the two. if there are none i would like
* Thus wrote Robert Janeczek ([EMAIL PROTECTED]):
hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed
some more good php5 info...
http://www.phparch.com/news/343
-Original Message-
From: Robert Janeczek [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 7:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php4 vs php5
hi, i`m working on presentation of php5 features and i would like
63 matches
Mail list logo