3v4l.org

run code in 500+ 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 = 36
Branch analysis from position: 24
2 jumps found. (Code = 47) Position 1 = 38, Position 2 = 44
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 36
Branch analysis from position: 23
Branch analysis from position: 17
filename:       /in/p0qa2
function name:  is_wp_version_compatible
number of ops:  46
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, ->36
   10    24    >   INIT_FCALL                                                   'error_log'
   12    25        ROPE_INIT                                         3  ~12     '%60'
         26        ROPE_ADD                                          1  ~12     ~12, !0
         27        ROPE_END                                          2  ~11     ~12, '%60+Not+a+valid+WordPress+version+string.'
         28        CONCAT                                               ~14     'is_wp_version_compatible%28%29%3A+', ~11
         29        SEND_VAL                                                     ~14
   10    30        DO_ICALL                                                     
   14    31        INIT_FCALL                                                   'rtrim'
         32        SEND_VAR                                                     !0
         33        SEND_VAL                                                     '.0'
         34        DO_ICALL                                             $16     
         35        ASSIGN                                                       !0, $16
   17    36    >   ISSET_ISEMPTY_CV                                     ~18     !0
         37      > JMPNZ_EX                                             ~18     ~18, ->44
         38    >   INIT_FCALL                                                   'version_compare'
         39        SEND_VAR                                                     !2
         40        SEND_VAR                                                     !0
         41        SEND_VAL                                                     '%3E%3D'
         42        DO_ICALL                                             $19     
         43        BOOL                                                 ~18     $19
         44    > > RETURN                                                       ~18
   18    45*     > RETURN                                                       null

End of function is_wp_version_compatible

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.26 ms | 1733 KiB | 23 Q