1--TEST-- 2str_ends_with() function - unit tests for str_ends_with() 3--FILE-- 4<?php 5$testStr = "beginningMiddleEnd"; 6var_dump(str_ends_with($testStr, "End")); 7var_dump(str_ends_with($testStr, "end")); 8var_dump(str_ends_with($testStr, "en")); 9var_dump(str_ends_with($testStr, $testStr)); 10var_dump(str_ends_with($testStr, $testStr.$testStr)); 11var_dump(str_ends_with($testStr, "")); 12var_dump(str_ends_with("", "")); 13var_dump(str_ends_with("", " ")); 14var_dump(str_ends_with($testStr, "\x00")); 15var_dump(str_ends_with("\x00", "")); 16var_dump(str_ends_with("\x00", "\x00")); 17var_dump(str_ends_with("a\x00", "\x00")); 18var_dump(str_ends_with("ab\x00c", "b\x00c")); 19var_dump(str_ends_with("a\x00b", "d\x00b")); 20var_dump(str_ends_with("a\x00b", "a\x00z")); 21var_dump(str_ends_with("a", "\x00a")); 22var_dump(str_ends_with("a", "a\x00")); 23?> 24--EXPECT-- 25bool(true) 26bool(false) 27bool(false) 28bool(true) 29bool(false) 30bool(true) 31bool(true) 32bool(false) 33bool(false) 34bool(true) 35bool(true) 36bool(true) 37bool(true) 38bool(false) 39bool(false) 40bool(false) 41bool(false) 42