3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cmp($v) { $r = version_compare( $v, '3.8', '<' ); $r = $r ? 'yes' : 'no'; echo $v . ' < 3.8 :' . $r . PHP_EOL; } cmp('3.3'); cmp('3.3.1'); cmp('3.3.2'); cmp('3.3.3'); cmp('3.4'); cmp('3.4.1'); cmp('3.4.2'); cmp('3.5'); cmp('3.5.1'); cmp('3.5.2'); cmp('3.6'); cmp('3.6.1'); cmp('3.7'); cmp('3.7.1'); cmp('3.7.2'); cmp('3.7.3'); echo '-----------------' . PHP_EOL; cmp('3.8'); cmp('3.8.1'); cmp('3.8.2'); cmp('3.8.3'); cmp('3.9'); cmp('3.9.1');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh7Qt
function name:  (null)
number of ops:  68
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'cmp'
          1        SEND_VAL                                                 '3.3'
          2        DO_FCALL                                      0          
   10     3        INIT_FCALL                                               'cmp'
          4        SEND_VAL                                                 '3.3.1'
          5        DO_FCALL                                      0          
   11     6        INIT_FCALL                                               'cmp'
          7        SEND_VAL                                                 '3.3.2'
          8        DO_FCALL                                      0          
   12     9        INIT_FCALL                                               'cmp'
         10        SEND_VAL                                                 '3.3.3'
         11        DO_FCALL                                      0          
   13    12        INIT_FCALL                                               'cmp'
         13        SEND_VAL                                                 '3.4'
         14        DO_FCALL                                      0          
   14    15        INIT_FCALL                                               'cmp'
         16        SEND_VAL                                                 '3.4.1'
         17        DO_FCALL                                      0          
   15    18        INIT_FCALL                                               'cmp'
         19        SEND_VAL                                                 '3.4.2'
         20        DO_FCALL                                      0          
   16    21        INIT_FCALL                                               'cmp'
         22        SEND_VAL                                                 '3.5'
         23        DO_FCALL                                      0          
   17    24        INIT_FCALL                                               'cmp'
         25        SEND_VAL                                                 '3.5.1'
         26        DO_FCALL                                      0          
   18    27        INIT_FCALL                                               'cmp'
         28        SEND_VAL                                                 '3.5.2'
         29        DO_FCALL                                      0          
   19    30        INIT_FCALL                                               'cmp'
         31        SEND_VAL                                                 '3.6'
         32        DO_FCALL                                      0          
   20    33        INIT_FCALL                                               'cmp'
         34        SEND_VAL                                                 '3.6.1'
         35        DO_FCALL                                      0          
   21    36        INIT_FCALL                                               'cmp'
         37        SEND_VAL                                                 '3.7'
         38        DO_FCALL                                      0          
   22    39        INIT_FCALL                                               'cmp'
         40        SEND_VAL                                                 '3.7.1'
         41        DO_FCALL                                      0          
   23    42        INIT_FCALL                                               'cmp'
         43        SEND_VAL                                                 '3.7.2'
         44        DO_FCALL                                      0          
   24    45        INIT_FCALL                                               'cmp'
         46        SEND_VAL                                                 '3.7.3'
         47        DO_FCALL                                      0          
   25    48        ECHO                                                     '-----------------%0A'
   26    49        INIT_FCALL                                               'cmp'
         50        SEND_VAL                                                 '3.8'
         51        DO_FCALL                                      0          
   27    52        INIT_FCALL                                               'cmp'
         53        SEND_VAL                                                 '3.8.1'
         54        DO_FCALL                                      0          
   28    55        INIT_FCALL                                               'cmp'
         56        SEND_VAL                                                 '3.8.2'
         57        DO_FCALL                                      0          
   29    58        INIT_FCALL                                               'cmp'
         59        SEND_VAL                                                 '3.8.3'
         60        DO_FCALL                                      0          
   30    61        INIT_FCALL                                               'cmp'
         62        SEND_VAL                                                 '3.9'
         63        DO_FCALL                                      0          
   31    64        INIT_FCALL                                               'cmp'
         65        SEND_VAL                                                 '3.9.1'
         66        DO_FCALL                                      0          
         67      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh7Qt
function name:  cmp
number of ops:  17
compiled vars:  !0 = $v, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'version_compare'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '3.8'
          4        SEND_VAL                                                 '%3C'
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !1, $2
    5     7      > JMPZ                                                     !1, ->10
          8    >   QM_ASSIGN                                        ~4      'yes'
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~4      'no'
         11    >   ASSIGN                                                   !1, ~4
    6    12        CONCAT                                           ~6      !0, '+%3C+3.8+%3A'
         13        CONCAT                                           ~7      ~6, !1
         14        CONCAT                                           ~8      ~7, '%0A'
         15        ECHO                                                     ~8
    7    16      > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.26 ms | 1403 KiB | 37 Q