PluginProbe
Yatra – Travel Booking & Tour Operator Software / trunk
Yatra – Travel Booking & Tour Operator Software vtrunk
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / includes / php-compat.php

php-compat.php in Yatra – Travel Booking & Tour Operator Software trunk, at includes/php-compat.php

36 lines 829 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Polyfills for PHP 8 string helpers when running on PHP 7.4.
4 * WordPress core also defines these when missing; this file is a no-op if they already exist.
5 */
6
7 if (!function_exists('str_contains')) {
8 /**
9 * @param string $haystack
10 * @param string $needle
11 */
12 function str_contains($haystack, $needle)
13 {
14 if ($needle === '') {
15 return true;
16 }
17
18 return strpos((string) $haystack, (string) $needle) !== false;
19 }
20 }
21
22 if (!function_exists('str_starts_with')) {
23 /**
24 * @param string $haystack
25 * @param string $needle
26 */
27 function str_starts_with($haystack, $needle)
28 {
29 if ($needle === '') {
30 return true;
31 }
32
33 return strncmp((string) $haystack, (string) $needle, strlen((string) $needle)) === 0;
34 }
35 }
36