3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php my_version_compare("2.5.1", "2.5.2"); # => -1 (smaller) my_version_compare("2.5.2", "2.5.2"); # => 0 (equal) my_version_compare("2.5.5", "2.5.2"); # => 1 (bigger) my_version_compare("2.5.11", "2.5.2"); # => 1 (bigger, eleven is bigger than two) function my_version_compare($version1, $version2) { var_dump(floatval($version1) >= $version2); }
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/Cstcg
function name:  (null)
number of ops:  18
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_FCALL_BY_NAME                                       'my_version_compare'
         1        SEND_VAL_EX                                              '2.5.1'
         2        SEND_VAL_EX                                              '2.5.2'
         3        DO_FCALL                                      0          
   4     4        INIT_FCALL_BY_NAME                                       'my_version_compare'
         5        SEND_VAL_EX                                              '2.5.2'
         6        SEND_VAL_EX                                              '2.5.2'
         7        DO_FCALL                                      0          
   5     8        INIT_FCALL_BY_NAME                                       'my_version_compare'
         9        SEND_VAL_EX                                              '2.5.5'
        10        SEND_VAL_EX                                              '2.5.2'
        11        DO_FCALL                                      0          
   6    12        INIT_FCALL_BY_NAME                                       'my_version_compare'
        13        SEND_VAL_EX                                              '2.5.11'
        14        SEND_VAL_EX                                              '2.5.2'
        15        DO_FCALL                                      0          
   8    16        NOP                                                      
  11    17      > RETURN                                                   1

Function my_version_compare:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/Cstcg
function name:  my_version_compare
number of ops:  10
compiled vars:  !0 = $version1, !1 = $version2
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   RECV                                             !0      
         1        RECV                                             !1      
   9     2        INIT_FCALL                                               'var_dump'
         3        INIT_FCALL                                               'floatval'
         4        SEND_VAR                                                 !0
         5        DO_ICALL                                         $2      
         6        IS_SMALLER_OR_EQUAL                              ~3      !1, $2
         7        SEND_VAL                                                 ~3
         8        DO_ICALL                                                 
  11     9      > RETURN                                                   null

End of function my_version_compare

Generated using Vulcan Logic Dumper, using php 7.2.0