-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
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 stringsarray- 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;