Auke van Slooten wrote:
Stanislav Malyshev wrote:
Hi!
IMHO __get is not consistent at the first place.
on possible example:
It is perfectly consistent. You just need to read what it actually does:
http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members
Stanislav Malyshev wrote:
Hi!
IMHO __get is not consistent at the first place.
on possible example:
It is perfectly consistent. You just need to read what it actually does:
http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members
instead of imagining wh
Stanislav Malyshev wrote:
Hi!
IMHO __get is not consistent at the first place.
on possible example:
It is perfectly consistent. You just need to read what it actually does:
http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members
instead of imagining wha
Hi!
IMHO __get is not consistent at the first place.
on possible example:
It is perfectly consistent. You just need to read what it actually does:
http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members
instead of imagining what it could do.
--
Stanislav M
Stanislav Malyshev wrote:
Hi!
So what you're saying is that it is *consistent* with regard to the
implementation of methods/functions, i.e. __get behaves as an
ordinary method.
Yes, it does.
IMHO __get is not consistent at the first place.
on possible example:
class A
{
protected $foo;
Hi!
So what you're saying is that it is *consistent* with regard to the
implementation of methods/functions, i.e. __get behaves as an
ordinary method.
Yes, it does.
--
Stanislav Malyshev, Zend Software Architect
s...@zend.com http://www.zend.com/
(408)253-8829 MSN: s...@zend.com
--
PHP I
I guess you're gonna hate this :)
So what you're saying is that it is *consistent* with regard to the
implementation of methods/functions, i.e. __get behaves as an
ordinary method.
On Fri, Mar 26, 2010 at 1:49 AM, Stanislav Malyshev wrote:
> Hi!
>
>> So, what's the reasoning behind this design
Hi!
So, what's the reasoning behind this design decision? Why is it supposed
to work like this and not the other way around?
Because when you return something by-value you can not have effects of
its modification reflect on the original value. That's how by-value
works. When you have by-ref
Hi,
On 3/22/2010 21:49, Stanislav Malyshev wrote:
Hi!
I guess what Mathieu is trying to say is that this:
...is inconsistent with this:
This is because you're doing it wrong. If you intend to modify the
property, return it by-ref. Saying the magic "consistency" word doesn't
change that.
No
Hi!
I guess what Mathieu is trying to say is that this:
...is inconsistent with this:
This is because you're doing it wrong. If you intend to modify the
property, return it by-ref. Saying the magic "consistency" word doesn't
change that.
Now, I'm not really sure this is that bad, as there
On Mon, Mar 22, 2010 at 5:12 PM, mathieu.suen
wrote:
> You are right I am using the wrong language but i can't help.
> Is not me who make the decision. So for want of anything better,
> why not try to improve the tool.
Improve it how exactly? I can't see how one can improve this part
while keepin
You are right I am using the wrong language but i can't help.
Is not me who make the decision. So for want of anything better,
why not try to improve the tool.
Peter Lind wrote:
Have you considered that perhaps you're trying to use the wrong
language for what you're doing? PHP does what it does
Have you considered that perhaps you're trying to use the wrong
language for what you're doing? PHP does what it does now consistently
(in this regard) - what you're suggesting breaks that consistency. To
gain what, exactly?
On 19 March 2010 17:07, mathieu.suen wrote:
> Right I could work around
Right I could work around the issue with the return by reference without
any problem.
I am still thinking that if you try to write a meta-circular interpreter
you gonna work very hard
to make this subtleties worked. And according to "Shriram Krishnamurthi"
in his textbook PLAI:
" a truly power
I guess what Mathieu is trying to say is that this:
class Foo
{
public $bar = array();
}
$foo = new Foo;
$foo->bar[3] = 1;
var_dump($foo);
...is inconsistent with this:
class Foo
{
public function __get($property)
{
if (!
Etienne Kneuss wrote:
On Thu, Mar 18, 2010 at 5:47 PM, mathieu.suen
wrote:
Peter Lind wrote:
On the contrary, it's quite obvious what's going on. In both examples
__get() returns an array as PHP would normally do it (i.e. NOT by
reference) which means that if you try to modify that you
On Thu, Mar 18, 2010 at 5:47 PM, mathieu.suen
wrote:
> Peter Lind wrote:
>>
>> On the contrary, it's quite obvious what's going on. In both examples
>> __get() returns an array as PHP would normally do it (i.e. NOT by
>> reference) which means that if you try to modify that you'll end up
>> modify
Peter Lind wrote:
On the contrary, it's quite obvious what's going on. In both examples
__get() returns an array as PHP would normally do it (i.e. NOT by
reference) which means that if you try to modify that you'll end up
modifying nothing much. However, in your second example, the point at
whic
Hello,
On Thu, Mar 18, 2010 at 8:49 AM, mathieu.suen
wrote:
> Etienne Kneuss wrote:
>>
>> Hello,
>>
>> On Wed, Mar 17, 2010 at 3:40 PM, mathieu.suen
>> wrote:
>>
>>>
>>> Ionut G. Stan wrote:
>>>
Hi,
This is interesting and it appears the following change makes the
snippe
> I think there is a lot to say why is not working but just look at those
> 2 execution:
>
> 1st
> class A
> {
>
> public function __get($name)
> {
> $this->$name = array();
> return $this->$name;
> }
>
> public function te
Etienne Kneuss wrote:
Hello,
On Wed, Mar 17, 2010 at 3:40 PM, mathieu.suen
wrote:
Ionut G. Stan wrote:
Hi,
This is interesting and it appears the following change makes the snippet
work as expected:
public function &__get($name);
I think is that the $this->anArray['bar']
Hello,
On Wed, Mar 17, 2010 at 3:40 PM, mathieu.suen
wrote:
> Ionut G. Stan wrote:
>>
>> Hi,
>>
>> This is interesting and it appears the following change makes the snippet
>> work as expected:
>>
>> public function &__get($name);
>
>
> I think is that the $this->anArray['bar'] = 4;
>
> Genera
Ionut G. Stan wrote:
Hi,
This is interesting and it appears the following change makes the
snippet work as expected:
public function &__get($name);
I think is that the $this->anArray['bar'] = 4;
Generate the following bytcode:
0 FETCH_OBJ_W $0
Hi,
This is interesting and it appears the following change makes the
snippet work as expected:
public function &__get($name);
On 3/17/10 3:55 PM, mathieu.suen wrote:
Hi,
I came across a strange behavior when using the magic method __get and
some instance variable that should be an ar
24 matches
Mail list logo