Skip to content

Consistent standard library #345

@thekid

Description

@thekid

Scope of Change

This RFC suggests creating a consistent standard library, which will be transpiled to the current function-based PHP standard library.

Rationale

Consistency when authoring without speed decrease at runtime.

Functionality

The API uses [group]::[function] as a principle, where group is one of:

  • str - Handling strings
  • array - Handling arrays

...and function is represented by the methods from JavaScript, a language every PHP programmer knows anyhow.

$s= 'Test,the,west';

// What we write
$l= str::length($s);
$p= str::indexOf($s, ',');

// What gets emitted
$l= \strlen($s);
$p= false === ($_p= \strpos($s, ',')) ? -1 : $_p;

Security considerations

Speed impact

Dependencies

Related documents

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions