473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

multiple stacks, multiple versions bother anybody, or is it just me?

Holding all versions at 5.0.4, Multiple stacks with multiple-version
configurations inevitable

Will have to wait to see what the impact of problems such as
http://bugs.php.net/bug.php?id=33643 to the application world. We may
wait for a suitable popular resolution and jump to that version in the
future. There's already a rift between PHP4 and PHP5, and then further
developments such as these create another, splitting the camp into 4.
The fix to the language nit affects both php4 and php5 going forward,
that is it breaks a lot of existing applications. I have had apps break
due to it.

There is also a discontinuity between MySQL 4 and MySQL 5. Apparently
the upgrade is so bad that XAMPP is not releasing an upgrade patch for
it's next versions. They require you to migrate the data manually.
Future versions of XAMPP stack are in doubt, or will at least be much
more of an effort now.

We can fix up our own code to run on certain stacks or versions of PHP
and MySQL, but we can't fix up all the 3rd party software that is out
there. Given the rate of brokenness between versions of the same thing
let alone configurations of things, multiple stacks are inevitable. Is
this cost-effective?

Or am I making a mountain out of a molehill?

Best regards,
-Rich

--

http://groups.yahoo.com/group/heuristic/

Nov 22 '05 #1
10 2100
Rich Kucera wrote:
Holding all versions at 5.0.4, Multiple stacks with multiple-version
configurations inevitable

Will have to wait to see what the impact of problems such as
http://bugs.php.net/bug.php?id=33643 to the application world. We may
wait for a suitable popular resolution and jump to that version in the
future. There's already a rift between PHP4 and PHP5, and then further
developments such as these create another, splitting the camp into 4.
The fix to the language nit affects both php4 and php5 going forward,
that is it breaks a lot of existing applications. I have had apps break
due to it.

There is also a discontinuity between MySQL 4 and MySQL 5. Apparently
the upgrade is so bad that XAMPP is not releasing an upgrade patch for
it's next versions. They require you to migrate the data manually.
Future versions of XAMPP stack are in doubt, or will at least be much
more of an effort now.

We can fix up our own code to run on certain stacks or versions of PHP
and MySQL, but we can't fix up all the 3rd party software that is out
there. Given the rate of brokenness between versions of the same thing
let alone configurations of things, multiple stacks are inevitable. Is
this cost-effective?

Or am I making a mountain out of a molehill?

Best regards,
-Rich

--

http://groups.yahoo.com/group/heuristic/


FWIW, I agree with the conclusion. Temporaries should not be passed as
references, either to a function or as a return value.

It won't affect my code at all, since I never did it in the first place.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #2
Why not? You never did this: $x = f1( f2( $y ) ); ?

For example:

$dir_path_component = array_pop( split('[/]',$dir) );

This syntax seems second nature to me. It is now broken.

You now have to inject a $foo variable into your syntax:

$dir_path_component = array_pop( $foo = split('[/]',$dir) );

Seems like other languages have solved whatever ill-effects result from
passing of function results to another function.

--

http://groups.yahoo.com/group/heuristic/

Nov 22 '05 #3
Rich Kucera wrote:
Why not? You never did this: $x = f1( f2( $y ) ); ?

For example:

$dir_path_component = array_pop( split('[/]',$dir) );

This syntax seems second nature to me. It is now broken.

You now have to inject a $foo variable into your syntax:

$dir_path_component = array_pop( $foo = split('[/]',$dir) );

Seems like other languages have solved whatever ill-effects result from
passing of function results to another function.

--

http://groups.yahoo.com/group/heuristic/


Sure - but not if f1() takes a reference. It works fine if f1() takes a
value.

For instance, what is supposed to happen if you do something like:

function f1 (&$i) {
$i++;
}

Java and C++ handle this by not allowing a temporary to be passed as a
reference (compiler error) - which is correct operation, IMHO.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #4
Jerry Stuckle wrote:

For instance, what is supposed to happen if you do something like:


I would like it to be run-time configurable in php.ini, where you can
opt for the old syntax where it does something reasonable which is
defined.

Before 5.0.5, it was perhaps buggy and undefined, but with a php.ini
setting you have the option to define the behavior in the case where a
function returns a temporary to a function expecting a reference.

It would be really cool to be able to set that ini option in a header
file for an application, so it wouldn't affect the entire server. Not
sure if that is possible with compiler directives.

--

http://groups.yahoo.com/group/heuristic/

Nov 22 '05 #5
Jerry Stuckle said the following on 15/11/2005 17:09:
Rich Kucera wrote:
Why not? You never did this: $x = f1( f2( $y ) ); ?

For example:

$dir_path_component = array_pop( split('[/]',$dir) );

This syntax seems second nature to me. It is now broken.

You now have to inject a $foo variable into your syntax:

$dir_path_component = array_pop( $foo = split('[/]',$dir) );

Seems like other languages have solved whatever ill-effects result from
passing of function results to another function.


Sure - but not if f1() takes a reference. It works fine if f1() takes a
value.

For instance, what is supposed to happen if you do something like:

function f1 (&$i) {
$i++;
}

Java and C++ handle this by not allowing a temporary to be passed as a
reference (compiler error) - which is correct operation, IMHO.

Well, Java doesn't do pass by reference, but it allows pass-by-value of
references to temporary objects, e.g.:

class Donkey
{
public Donkey(String name)
{
this.name = name;
}

public String name;
}
public class test
{
static Donkey foo()
{
return new Donkey("Eeyore");
}

static void bar(Donkey d)
{
System.out.println("Donkey name: " + d.name);
}

public static void main(String[] args)
{
// pass value of reference to temp object
bar(foo());
}
}

C++ gets round this if the function is expecting a const reference, e.g.:

int foo()
{
return 4;
}

void bar (const int &i) // expecting const reference
{
printf("Value: %d\n", i);
}

int main()
{
bar(foo()); // pass temp value

return 0;
}

Obviously, PHP doesn't really do type-checking, so a PHP equivalent of
const could never be enforced.

Which is a shame, as it means that one can't differentiate between
passing by reference to eliminate object copying, and passing by
reference to allow alteration of the original object.

However, even in Jerry's example, even without the benefit of const
enforcement, I don't see why PHP can't just assign to the temporary
variable - what harm would it do?
--
Oli
Nov 22 '05 #6
Rich Kucera wrote:
Jerry Stuckle wrote:
For instance, what is supposed to happen if you do something like:

I would like it to be run-time configurable in php.ini, where you can
opt for the old syntax where it does something reasonable which is
defined.

Before 5.0.5, it was perhaps buggy and undefined, but with a php.ini
setting you have the option to define the behavior in the case where a
function returns a temporary to a function expecting a reference.

It would be really cool to be able to set that ini option in a header
file for an application, so it wouldn't affect the entire server. Not
sure if that is possible with compiler directives.

--

http://groups.yahoo.com/group/heuristic/


You mean like register_globals? Look at all the incompatibility
problems that's caused over the years!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #7
Oli Filth wrote:
Jerry Stuckle said the following on 15/11/2005 17:09:
Rich Kucera wrote:
Why not? You never did this: $x = f1( f2( $y ) ); ?

For example:

$dir_path_component = array_pop( split('[/]',$dir) );

This syntax seems second nature to me. It is now broken.

You now have to inject a $foo variable into your syntax:

$dir_path_component = array_pop( $foo = split('[/]',$dir) );

Seems like other languages have solved whatever ill-effects result from
passing of function results to another function.


Sure - but not if f1() takes a reference. It works fine if f1() takes
a value.

For instance, what is supposed to happen if you do something like:

function f1 (&$i) {
$i++;
}

Java and C++ handle this by not allowing a temporary to be passed as a
reference (compiler error) - which is correct operation, IMHO.


Well, Java doesn't do pass by reference, but it allows pass-by-value of
references to temporary objects, e.g.:

class Donkey
{
public Donkey(String name)
{
this.name = name;
}

public String name;
}
public class test
{
static Donkey foo()
{
return new Donkey("Eeyore");
}

static void bar(Donkey d)
{
System.out.println("Donkey name: " + d.name);
}

public static void main(String[] args)
{
// pass value of reference to temp object
bar(foo());
}
}

C++ gets round this if the function is expecting a const reference, e.g.:

int foo()
{
return 4;
}

void bar (const int &i) // expecting const reference
{
printf("Value: %d\n", i);
}

int main()
{
bar(foo()); // pass temp value

return 0;
}

Obviously, PHP doesn't really do type-checking, so a PHP equivalent of
const could never be enforced.

Which is a shame, as it means that one can't differentiate between
passing by reference to eliminate object copying, and passing by
reference to allow alteration of the original object.

However, even in Jerry's example, even without the benefit of const
enforcement, I don't see why PHP can't just assign to the temporary
variable - what harm would it do?


Yes, C++ allows a *const* reference. But it doesn't allow a non-const
reference.

But then let's take another case:

f1(3);

NOW what does f1 increment?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #8
Jerry Stuckle said the following on 15/11/2005 20:02:
Oli Filth wrote:
Jerry Stuckle said the following on 15/11/2005 17:09:

For instance, what is supposed to happen if you do something like:

function f1 (&$i) {
$i++;
}

Java and C++ handle this by not allowing a temporary to be passed as
a reference (compiler error) - which is correct operation, IMHO.

However, even in Jerry's example, even without the benefit of const
enforcement, I don't see why PHP can't just assign to the temporary
variable - what harm would it do?


But then let's take another case:

f1(3);

NOW what does f1 increment?


Good example!

In that case, I repeat my disappointment that PHP doesn't allow one the
option to indicate a constant reference!!

Alternatively, maybe PHP should throw an error if a literal is passed
(as in your 2nd example), but cope with temporary variables - although
there's probably a caveat I'm not seeing with that either...

--
Oli
Nov 22 '05 #9
On 15 Nov 2005 10:48:25 -0800, "Rich Kucera" <us*******@yahoo.com>
wrote:
I would like it to be run-time configurable in php.ini
Please god no!!!!! We've been there, we've done that. The php.ini is
not the place to put language altering directives!
It would be really cool to be able to set that ini option in a header
file for an application, so it wouldn't affect the entire server. Not
sure if that is possible with compiler directives.


I think the problem is pretty rare. You're example:

$dir_path_component = array_pop(split('[/]',$dir));

is a good one. But it's not really want you want to do here. You
don't want to pop the top element off of the result, you just want to
return the first item of it. Unfortuantely, PHP doesn't allow you to
the following:

$dir_path_component = split('[/]',$dir)[0];

However, you could write your own function to handle it cleanly. Lets
call that function array_first:

function array_first($array) {
return (isset($array[0]) ? $array[0] : null;
}

$dir_path_component = array_first(split('[/]',$dir));

Problem solved.

Nov 22 '05 #10
On Tue, 15 Nov 2005 19:20:39 GMT, Oli Filth <ca***@olifilth.co.uk>
wrote:
Which is a shame, as it means that one can't differentiate between
passing by reference to eliminate object copying, and passing by
reference to allow alteration of the original object.


Since PHP uses copy-on-write semantics for all values there is no
object copying in PHP. Therefore there is no reason to references in
PHP unless you want to allow alteration of the original object. In
PHP, using references is actually more expensive than not using
references.

Nov 22 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Gabriele Farina | last post by:
Hi, I'd like to manage multiple socket connection without having to use Threads. I'd like to manage every connection when it is returned from socket_Accept(), without having to wait for the...
1
by: Zen | last post by:
From http://support.microsoft.com/kb/828956/ "Note Microsoft does not support the use of multiple versions of Microsoft Office on a Terminal Server. Coexistence is not supported on versions...
19
by: santosh | last post by:
Hi all, In the following program I allocate a block of pointers to type char, initialised to zero. I then point each of those pointers to a block of allocated memory of fixed size (33 bytes). A...
2
by: Daniel | last post by:
Hi, I have a question regarding the memory managment in stl stacks. I want to use stacks to store a very large amount of numbers (some millions), thus I'm interested in how the stack behaves...
0
by: raghuveer | last post by:
i want to implement multiple stacks using arrays..I am able to create ,insert and print them but not poping an element form any of the stack..This is what i have #include<stdio.h>...
14
by: MLH | last post by:
Suppose you needed to print a large number of consecutively numbered documents the size of a post-card ==or perhaps even a business card using a laser printer and 60# bond. Suppose you planned to...
37
by: Allen Browne | last post by:
If you develop for others, you probably have multiple versions of Access installed so you can edit and create MDEs for clients in different versions. This works fine under Windows XP, even with...
8
by: cerise | last post by:
I can't figure out how to make and handle multiple stacks and use them so I could create four linked list stacks representing each suit of cards, one stack each for diamonds, hearts, spades, and...
2
by: Nathan Sokalski | last post by:
I have a Repeater that uses a DataSource that has multiple fields. When the values of these fields is displayed in the Repeater, there are fields that are used in combination with other fields as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.