3v4l.org

run code in 300+ PHP versions simultaneously
<?php $md = <<<'MD' 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! = 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). MD; $versions = []; $currentVersion = ''; $ignore = true; foreach(explode("\n", $md) as $line) { if (str_starts_with($line, '== Upgrade Notice ==')) { $ignore = false; continue; } if (preg_match('/^= ([0-9.]+) =/', $line, $matches)) { $currentVersion = $matches[1]; continue; } if (true === $ignore || '' === $currentVersion) { continue; } $versions[$currentVersion][] = $line; } print_r($versions);
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
Array ( [1.3.0] => Array ( [0] => [1] => When using Master Pro, 1.3.0 is the new minimal required version! [2] => ) [1.1.0] => Array ( [0] => [1] => When using Master Pro, 1.1.0 is the new minimal required version! [2] => ) [1.0.0] => Array ( [0] => [1] => No upgrade - just install :) [2] => [3] => [See changelog for all versions](https://plugins.svn.wordpress.org/master-pro/trunk/CHANGELOG.md). ) )

preferences:
69.7 ms | 408 KiB | 5 Q