1--TEST--
2str_starts_with() function - unit tests for str_starts_with()
3--FILE--
4<?php
5$testStr = "beginningMiddleEnd";
6var_dump(str_starts_with($testStr, "beginning"));
7var_dump(str_starts_with($testStr, "Beginning"));
8var_dump(str_starts_with($testStr, "eginning"));
9var_dump(str_starts_with($testStr, $testStr));
10var_dump(str_starts_with($testStr, $testStr.$testStr));
11var_dump(str_starts_with($testStr, ""));
12var_dump(str_starts_with("", ""));
13var_dump(str_starts_with("", " "));
14var_dump(str_starts_with($testStr, "\x00"));
15var_dump(str_starts_with("\x00", ""));
16var_dump(str_starts_with("\x00", "\x00"));
17var_dump(str_starts_with("\x00a", "\x00"));
18var_dump(str_starts_with("a\x00bc", "a\x00b"));
19var_dump(str_starts_with("a\x00b", "a\x00d"));
20var_dump(str_starts_with("a\x00b", "z\x00b"));
21var_dump(str_starts_with("a", "a\x00"));
22var_dump(str_starts_with("a", "\x00a"));
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