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');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WY3aE
function name:  (null)
number of ops:  18
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Some+stuff+before+this+notice+which+is+not+relevant.%0A%0A%3D%3D+Upgrade+Notice+%3D%3D%0A%0A%3D+1.3.0+%3D%0A%0AWhen+using+Master+Pro%2C+1.3.0+is+the+new+minimal+required+version%21%0AWhen+using+Master+Pro%2C+1.3.0+is+the+new+minimal+required+version%21%0AWhen+using+Master+Pro%2C+1.3.0+is+the+new+minimal+required+version%21%0A++++%0A123123%0A%0A%3D+1.1.0+%3D%0A%0AWhen+using+Master+Pro%2C+1.1.0+is+the+new+minimal+required+version%21%0A%0A%3D+1.0.0+%3D%0A%0ANo+upgrade+-+just+install+%3A%29%0A%0A%5BSee+changelog+for+all+versions%5D%28https%3A%2F%2Fplugins.svn.wordpress.org%2Fmaster-pro%2Ftrunk%2FCHANGELOG.md%29.'
   37     1        INIT_FCALL                                               'parse_update_notice'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '1.3.0'
          4        DO_FCALL                                      0          
   38     5        INIT_FCALL                                               'parse_update_notice'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 '1.1.0'
          8        DO_FCALL                                      0          
   39     9        INIT_FCALL                                               'parse_update_notice'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '1.0.0'
         12        DO_FCALL                                      0          
   40    13        INIT_FCALL                                               'parse_update_notice'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '0.1.0'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Function parse_update_notice:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/WY3aE
function name:  parse_update_notice
number of ops:  21
compiled vars:  !0 = $content, !1 = $new_version, !2 = $regexp, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   29     2        INIT_FCALL                                               'preg_quote'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      '%7E%3D%3D%5Cs%2AUpgrade+Notice%5Cs%2A%3D%3D%5Cs%2A.%2A%3F%3D%2B%5Cs%2A%28', $4
          6        CONCAT                                           ~6      ~5, '%29%5Cs%2A%3D%2B%5Cs%2A%28.%2A%3F%29%28%3F%3D%5E%3D%2B%5Cs%2A%5Cd%2B%5C.%5Cd%2B%5C.%5Cd%2B%5Cs%2A%3D%2B%7C%5E%5Cs%2A%3F%24%29%7Ems'
          7        ASSIGN                                                   !2, ~6
   31     8        INIT_FCALL                                               'preg_match'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !0
         11        SEND_REF                                                 !3
         12        DO_ICALL                                         $8      
         13      > JMPZ                                                     $8, ->20
   32    14    >   FETCH_DIM_R                                      ~9      !3, 1
         15        ECHO                                                     ~9
         16        ECHO                                                     '%0A'
   33    17        FETCH_DIM_R                                      ~10     !3, 2
         18        ECHO                                                     ~10
         19        ECHO                                                     '%0A'
   35    20    > > RETURN                                                   null

End of function parse_update_notice

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.02 ms | 1006 KiB | 19 Q