3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_wp_version_compatible( $required ) { $wp_version = '6.4.1'; // Strip off any -alpha, -RC, -beta, -src suffixes. list( $version ) = explode( '-', $wp_version ); if ( is_string( $required ) && substr_count( $required, '.' ) > 1 && str_ends_with( $required, '.0' ) ) { error_log(__FUNCTION__ . '(): ' . /* translators: s: version string sent to function */ sprintf( '`%s` Not a valid WordPress version string.', $required ) ); $required = rtrim( $required, '.0' ); } return empty( $required ) || version_compare( $version, $required, '>=' ); } echo is_wp_version_compatible('6.4'); echo is_wp_version_compatible('3.0'); echo is_wp_version_compatible('3.0.0'); echo is_wp_version_compatible('6.4.1');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0qa2
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'is_wp_version_compatible'
          1        SEND_VAL                                                 '6.4'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   21     4        INIT_FCALL                                               'is_wp_version_compatible'
          5        SEND_VAL                                                 '3.0'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
   22     8        INIT_FCALL                                               'is_wp_version_compatible'
          9        SEND_VAL                                                 '3.0.0'
         10        DO_FCALL                                      0  $2      
         11        ECHO                                                     $2
   23    12        INIT_FCALL                                               'is_wp_version_compatible'
         13        SEND_VAL                                                 '6.4.1'
         14        DO_FCALL                                      0  $3      
         15        ECHO                                                     $3
         16      > RETURN                                                   1

Function is_wp_version_compatible:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 37
Branch analysis from position: 24
2 jumps found. (Code = 47) Position 1 = 39, Position 2 = 45
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 37
Branch analysis from position: 23
Branch analysis from position: 17
filename:       /in/p0qa2
function name:  is_wp_version_compatible
number of ops:  47
compiled vars:  !0 = $required, !1 = $wp_version, !2 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '6.4.1'
    7     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '-'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        FETCH_LIST_R                                     $5      $4, 0
          7        ASSIGN                                                   !2, $5
          8        FREE                                                     $4
    9     9        TYPE_CHECK                                   64  ~7      !0
         10      > JMPZ_EX                                          ~7      ~7, ->17
         11    >   INIT_FCALL                                               'substr_count'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 '.'
         14        DO_ICALL                                         $8      
         15        IS_SMALLER                                       ~9      1, $8
         16        BOOL                                             ~7      ~9
         17    > > JMPZ_EX                                          ~7      ~7, ->23
         18    >   INIT_FCALL                                               'str_ends_with'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 '.0'
         21        DO_ICALL                                         $10     
         22        BOOL                                             ~7      $10
         23    > > JMPZ                                                     ~7, ->37
   10    24    >   INIT_FCALL                                               'error_log'
   12    25        INIT_FCALL                                               'sprintf'
         26        SEND_VAL                                                 '%60%25s%60+Not+a+valid+WordPress+version+string.'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $11     
         29        CONCAT                                           ~12     'is_wp_version_compatible%28%29%3A+', $11
         30        SEND_VAL                                                 ~12
   10    31        DO_ICALL                                                 
   14    32        INIT_FCALL                                               'rtrim'
         33        SEND_VAR                                                 !0
         34        SEND_VAL                                                 '.0'
         35        DO_ICALL                                         $14     
         36        ASSIGN                                                   !0, $14
   17    37    >   ISSET_ISEMPTY_CV                                 ~16     !0
         38      > JMPNZ_EX                                         ~16     ~16, ->45
         39    >   INIT_FCALL                                               'version_compare'
         40        SEND_VAR                                                 !2
         41        SEND_VAR                                                 !0
         42        SEND_VAL                                                 '%3E%3D'
         43        DO_ICALL                                         $17     
         44        BOOL                                             ~16     $17
         45    > > RETURN                                                   ~16
   18    46*     > RETURN                                                   null

End of function is_wp_version_compatible

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.93 ms | 1473 KiB | 24 Q