<?php $delimiter = '123'; $func1 = fn(string $prefix): bool => $prefix !== '' && !str_ends_with($prefix, $delimiter); $func2 = fn(string $prefix): bool => !str_ends_with($prefix, $delimiter); $result = $func1('abc'); $result2 = $func1(''); $result3 = $func2('abc'); $result4 = $func2(''); var_dump( $result, $result2, $result3, $result4, );
You have javascript disabled. You will not be able to edit any code.