nikic / scalar_objects

Extension that adds support for method calls on primitive types in PHP
MIT License
1.13k stars 44 forks source link

RFC probability #48

Open abramchikd opened 11 months ago

abramchikd commented 11 months ago

Hey! Is there any chance that this will be implemented as and RFC?

I can also think of another method of achieving such functionality: allowing any function to be called as an extension method. If the left operand of $a->callSomething() is a primitive type or the method on object does not exist and __call is not implemented, then try to execute callSomething as a function and pass $a as a first parameter. Are there any drawbacks of implementing it this way? I tried to do it myself, but php src seems to be too complicated for me

abramchikd commented 11 months ago

@nikic