peachpiecompiler/peachpie

How to call c# extension methods in php?

FibonacciFox opened this issue · 1 comments

Hello, dear developers peachpie.
When I call c# extension methods, throws an exception: Error: Call to undefined method. How can I call them from php?

Hi, Extension methods are a C# language feature - PHP does not have extension methods.

In order to use them in PHP, call them through their static class

instead of $obj->extensionMethod()
use the static class name: ExtensionMethodClass::extensionMethod( $obj );