October 25, 2024
Chicago 12, Melborne City, USA
PHP

Is possible to define a typedef for complex and composite datatypes in PHP or Laravel?


Is there a way to define a special type just a placeholder for complex return data types?

Builder|Payment|Model
Can I define a typedef for this?
PaymentBuilder => Builder|Payment|Model

And return the new datatype for the methods in certain class.

Is that possible?

I am trying to create a user-defined typedef in PHP.

I expect to use this typedef in class files instead of the actual composite datatypes – to be returned for example.

I can’t do this right now 🙁



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video