php 8 match

Solutions on MaxInterview for php 8 match by the best coders in the world

showing results for - "php 8 match"
Kyan
18 Sep 2016
1echo match (8.0) {
2  '8.0' => "Oh no!",
3  8.0 => "This is what I expected",
4};
5//> This is what I expected
Estee
04 Mar 2020
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?>
Naomi
02 May 2016
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