3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<EOF Some stuff before this notice which is not relevant. == Upgrade Notice == = 1.3.0 = When using Master Pro, 1.3.0 is the new minimal required version! When using Master Pro, 1.3.0 is the new minimal required version! When using Master Pro, 1.3.0 is the new minimal required version! 123123 = 1.1.0 = When using Master Pro, 1.1.0 is the new minimal required version! = 1.0.0 = No upgrade - just install :) [See changelog for all versions](https://plugins.svn.wordpress.org/master-pro/trunk/CHANGELOG.md). EOF; function parse_update_notice( string $content, string $new_version ) { $regexp = '~==\s*Upgrade Notice\s*==\s*.*?=+\s*(' . preg_quote( $new_version ) . ')\s*=+\s*(.*?)(?=^=+\s*\d+\.\d+\.\d+\s*=+|^\s*?$)~ms'; if ( preg_match( $regexp, $content, $matches ) ) { echo $matches[1], PHP_EOL; echo $matches[2], PHP_EOL; } } parse_update_notice($content, '1.3.0'); parse_update_notice($content, '1.1.0'); parse_update_notice($content, '1.0.0'); parse_update_notice($content, '0.1.0');
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
1.3.0 When using Master Pro, 1.3.0 is the new minimal required version! When using Master Pro, 1.3.0 is the new minimal required version! When using Master Pro, 1.3.0 is the new minimal required version! 1.1.0 When using Master Pro, 1.1.0 is the new minimal required version! 1.0.0 No upgrade - just install :)

preferences:
66.6 ms | 407 KiB | 5 Q