stanley-king 2 năm trước cách đây
mục cha
commit
b0a6c7028b
1 tập tin đã thay đổi với 10 bổ sung5 xóa
  1. 10 5
      test/TestPHPLan.php

+ 10 - 5
test/TestPHPLan.php

@@ -19,18 +19,23 @@ class TestPHPLan extends TestCase
 
 
     public function testFS()
     public function testFS()
     {
     {
-        $isfs = function ($name)
+        $str_ends_with = function (string $haystack, string $needle): bool
         {
         {
-            $names = [];
-            if(in_array($name,$names)) {
+            if ('' === $needle || $needle === $haystack) {
                 return true;
                 return true;
             }
             }
 
 
+            if ('' === $haystack) {
+                return false;
+            }
 
 
+            $needleLength = strlen($needle);
 
 
-
+            return $needleLength <= strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
         };
         };
-        $a = $isfs();
+
+        $a = $str_ends_with('huoshenguo','fs');
+        $b = 1;
     }
     }
 
 
 }
 }