3v4l.org

run code in 300+ PHP versions simultaneously
<?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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cstcg
function name:  (null)
number of ops:  17
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          
   11    16      > RETURN                                                   1

Function my_version_compare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cstcg
function name:  my_version_compare
number of ops:  8
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        CAST                                          5  ~2      !0
          4        IS_SMALLER_OR_EQUAL                              ~3      !1, ~2
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                                 
   11     7      > RETURN                                                   null

End of function my_version_compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.99 ms | 1387 KiB | 15 Q