1echo match (8.0) {
2 '8.0' => "Oh no!",
3 8.0 => "This is what I expected",
4};
5//> This is what I expected
1<?php
2$food = 'cake';
3
4$return_value = match ($food) {
5 'apple' => 'This food is an apple',
6 'bar' => 'This food is a bar',
7 'cake' => 'This food is a cake',
8};
9
10var_dump($return_value);
11?>
1echo match (8.0) {
2 '8.0' => "Oh no!",
3 8.0 => "This is what I expected",
4};
5//> This is what I expected
6// TurkoSoft