3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); assert(str_contains('Ahoy World!', 'Ahoy') === true); assert(str_contains('Ahoy World!', 'Hello') === false); assert(str_starts_with('Ahoy World!', 'Ahoy') === true); assert(str_starts_with('AhoyWorld', 'Hello') === false); assert(str_ends_with('Ahoy World!', 'World!') === true); assert(str_ends_with('Ahoy World!', 'Ahoy') === false);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Call to undefined function str_contains() in /in/cgeR4:5 Stack trace: #0 {main} thrown in /in/cgeR4 on line 5
Process exited with code 255.

preferences:
185.63 ms | 403 KiB | 188 Q