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);

preferences:
24.43 ms | 407 KiB | 5 Q