What is the php_operator.dll extension

What is the php_operator.dll extension

am 14.11.2007 14:47:48 von Andyza

I've successfully set up PHP 5.2.4 on my dev box and all is running
well. Originally I had the php_operator.dll extension loaded and it
caused one of my applications (Moodle 1.8) to regularly throw "PHP has
encountered an Access Violation at 022C7BF0" errors. As soon as I
disabled the php_operator.dll extension everything started running
smoothly.

But now I'd like to know what PHP functionality I've disabled by
disabling this php_operator.dll extension. Does anybody know what this
php_operator.dll extension is? What does it do?

I've tried using an older version of the PHP and a version from a more
recent build of the 5.2.4 branch of PHP, but I still get the access
violation errors.

Thanks.

Re: What is the php_operator.dll extension

am 14.11.2007 17:43:31 von Michael Fesser

..oO(DiamondEagle)

>But now I'd like to know what PHP functionality I've disabled by
>disabling this php_operator.dll extension. Does anybody know what this
>php_operator.dll extension is? What does it do?

It's probably the PECL extension of the same name.

http://pecl.php.net/package/operator

Micha

Re: What is the php_operator.dll extension

am 16.11.2007 11:54:08 von Andyza

Michael Fesser wrote:
>
> It's probably the PECL extension of the same name.
>
> http://pecl.php.net/package/operator

Aaah! Thanks!

The summary for the Operator package on that page says that it's:
"Operator overloading for Objects", but nothing more. What does that
mean?

Thanks.

Re: What is the php_operator.dll extension

am 16.11.2007 14:50:31 von Michael Fesser

..oO(DiamondEagle)

>Michael Fesser wrote:
>>
>> It's probably the PECL extension of the same name.
>>
>> http://pecl.php.net/package/operator
>
>Aaah! Thanks!
>
>The summary for the Operator package on that page says that it's:
>"Operator overloading for Objects", but nothing more. What does that
>mean?

Overloading an operator means to define your own methods for it, so you
can use all the predefined operators even with your own objects.

Let's say for example we have a class for complex numbers. The simple
mathematical operators +, -, ... won't work anymore, because complex
numbers have their own rules. So in order to perform calculations with
them, you have to define and use your own methods, e.g.

$c1 = new Complex(5, 7);
$c2 = new Complex(23, 42);
$c1->add($c2); // $c1 becomes (28, 49)

Now with operator overloading you could change the behaviour of the
predefined operators, so that you can still use the nicer syntax, but
internally they will automatically call your method instead:

$c1 = $c1 + $c2; // will call $c1->add(), same result as above

Micha

Re: What is the php_operator.dll extension

am 21.11.2007 10:48:36 von Andyza

On Nov 16, 3:50 pm, Michael Fesser wrote:
>
> Overloading an operator means to define your own methods for it, so you
> can use all the predefined operators even with your own objects.
>


Thanks. It makes sense now...