Using references does not speed up PHP. It does that already
internally, if I'm not mistaken. The point of my post was that
assigning values to tree arrays are in general faster than a full
array copy.
Hannes
On 19 January 2011 08:36, Ben Schmidt mail_ben_schm...@yahoo.com.au wrote:
Yep. PHP
On 19/01/11 16:14, Sam Vilain wrote:
In general, Java's basic types typically correspond with types that can
be dealt with atomically by processors, or are small enough to be passed
by value. This already makes things a lot easier.
I've had another reason for the differences explained to me.
What about objects?
class Foo {
public $foo;
}
function test($o) {
$o-foo-foo-foo = 2;
}
$bar = new Foo;
$bar-foo = new Foo;
$bar-foo-foo = new Foo;
test( $bar );
---
Also... is it better to pass an object as a parameter rather than many
values?
function withValues($anInteger,
I think the point is that the php language itself does not provide solid
construct for writing rock-solid code. Yes, there are many
programmers/hackers that can, but the effort they put is huge.
it's so easy to break well-written bug-free code, that's impossible for
developers to share libraries,
hi,
On Wed, Jan 19, 2011 at 4:41 PM, Martin Scotta martinsco...@gmail.com wrote:
I think the point is that the php language itself does not provide solid
construct for writing rock-solid code. Yes, there are many
programmers/hackers that can, but the effort they put is huge.
Care to enlighten
On 1/19/11 7:50 AM, Pierre Joye wrote:
Honestly if a given part of an application needs something along this
line for performance reasons, then doing that on the same box where
the request is executed may be a bad idea. Tools like gearman will do
a far better jobs and will let you do resource
On Wed, 19 Jan 2011 14:23:49 -, Martin Scotta martinsco...@gmail.com
wrote:
What about objects?
With objects less copying occurs because the object value (zval) data is
actually just a pointer and an id that for most purposes works as a
pointer.
However, it should be said that
So it sounds like the general answer is that if you pass a complex array
to a function by value and mess with it, data is duplicated for every
item you modify and its direct ancestors up to the root variable but not
for the rest of the tree.
For objects, because of their pass by handle-type
On 19 January 2011 20:05, la...@garfieldtech.com la...@garfieldtech.com wrote:
So it sounds like the general answer is that if you pass a complex array to
a function by value and mess with it, data is duplicated for every item you
modify and its direct ancestors up to the root variable but not
Hi!
I think the point is that the php language itself does not provide solid
construct for writing rock-solid code. Yes, there are many
programmers/hackers that can, but the effort they put is huge.
I think this is completely untrue.
In Java you are free to extend a class --yours or
Have you taken a look at Runkit_Sandbox? It may provide useful tips.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On 20/01/11 10:17, Ángel González wrote:
Have you taken a look at Runkit_Sandbox? It may provide useful tips.
*headdesk*
No, I hadn't seen that. Thanks for pointing this out, it looks like
exactly what I was trying to reinvent...
Cheers,
Sam.
--
PHP Internals - PHP Runtime Development
On 19/01/11 23:10, Sam Vilain wrote:
On 20/01/11 10:17, Ángel González wrote:
Have you taken a look at Runkit_Sandbox? It may provide useful tips.
*headdesk*
No, I hadn't seen that. Thanks for pointing this out, it looks like
exactly what I was trying to reinvent...
Cheers,
Sam.
You may
On 20/01/11 6:05 AM, la...@garfieldtech.com wrote:
So it sounds like the general answer is that if you pass a complex array to a
function by value and mess with it, data is duplicated for every item you modify
and its direct ancestors up to the root variable but not for the rest of the
tree.
Hi Sam:
(becomes off-topic here, but for the sake of argument)
On 19 Jan 2011, at 04:14, Sam Vilain wrote:
On 19/01/11 10:50, Stefan Marr wrote:
On 18 Jan 2011, at 22:16, Sam Vilain wrote:
there doesn't seem to
be an interpreter under the sun which has successfully pulled off
threading
Many PHP features should be language constructs, but they were made as
language hacks.
__construct is evil, as like any other language hack
It does not provides a safe fundation to build safe abstractions, reusable
and extendibles components, which leads to the lack of PHP libraries.
Let's
Hi!
Many PHP features should be language constructs, but they were made as
language hacks.
__construct is evil, as like any other language hack
Constructors are standard feature in many languages. There's nothing
evil in them.
class Client {
function __construct() {
// some
On Wednesday, January 19, 2011 4:45:14 pm Ben Schmidt wrote:
Related: What is the overhead of a ZVal? I'm assuming it's a fixed
number of bytes.
It seems not, though a zval has a fixed size. What that size is will
depend on the compiler and architecture of the system being used, or at
18 matches
Mail list logo