Skip to content

Support declaring PHP functions using "funky" #2234

Description

@ZachWatkins

The PHP language files should support declaring a function like function processData() using the funky phrase. Possible solutions:

  1. Use a code function modifier like global funky process data to print function processData().
  2. Change default behavior for the funky process data phrase in PHP to match JavaScript's default behavior for the same phrase, which prints function processData().

PHP is most commonly used in an object-oriented way, so it may be more useful for the default behavior for funky process data to remain global function processData(). PHP developers may write something like public function processData() more often day-to-day than function processData().

One downside to keeping this current default behavior is that it is not the default behavior for JavaScript, so users may not be expecting different default behavior between two languages. Another reason to go with option 2 is that there is already support for the public modifier using pub funky.

I am open to suggestions. I've been writing PHP for 13 years and I think Option 2 is the more intuitive choice, so I will submit a pull requested for this issue next month that implements Option 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions