mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-11 17:09:41 +01:00
19 lines
269 B
Plaintext
19 lines
269 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;
|
||
|
-----
|
||
|
!!php7
|
||
|
fn($a) => $a;
|
||
|
fn($x = 42) => $x;
|
||
|
fn(&$x) => $x;
|
||
|
fn&($x) => $x;
|
||
|
static fn($x, ...$rest) => $rest;
|
||
|
fn(): int => $x;
|