Skip to content

Instantly share code, notes, and snippets.

View bobwol's full-sized avatar
💭
coding as usual

bobwol

💭
coding as usual
View GitHub Profile
@nextgenthemes
nextgenthemes / fn-php80-str-polyfills.php
Last active November 13, 2024 14:24
Proper minimalistic str_contains, str_starts_with and str_ends_with polyfills with WordPress coding standards
<?php
/**
* These are based on symfony/polyfill-php80. The aim of this is to have a minimalistic polyfill
* for only the str_* functions of PHP 8.0. Requires php 7.1 or higher.
*
* @link https://github.com/symfony/polyfill-php80/blob/1.x/bootstrap.php
* @link https://github.com/symfony/polyfill-php80/blob/1.x/Php80.php
*
* @license GPL-3.0
* @copyright (c) Fabien Potencier <[email protected]>, (c) 2024 Nicolas Jonas nextgenthemes.com