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.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
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:
64.81 ms | 407 KiB | 5 Q