mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-10 22:58:53 +01:00
e03d63cffb
Arrow functions should have lowest precedence. Fixes #769.
22 lines
366 B
Plaintext
22 lines
366 B
Plaintext
Arrow function
|
|
-----
|
|
<?php
|
|
|
|
fn($a) => $a;
|
|
fn($x = 42) => $x;
|
|
fn(&$x) => $x;
|
|
fn&($x) => $x;
|
|
static fn($x, ...$rest) => $rest;
|
|
fn(): int => $x;
|
|
fn($a, $b) => $a and $b;
|
|
fn($a, $b) => $a && $b;
|
|
-----
|
|
!!php7
|
|
fn($a) => $a;
|
|
fn($x = 42) => $x;
|
|
fn(&$x) => $x;
|
|
fn&($x) => $x;
|
|
static fn($x, ...$rest) => $rest;
|
|
fn(): int => $x;
|
|
fn($a, $b) => $a and $b;
|
|
fn($a, $b) => $a && $b; |