3v4l.org

run code in 300+ PHP versions simultaneously
<?php function new_new_version_compare($a, $b){ return explode(".", $a) <=> explode(".", $b); } $versions = ["2.5.1", "2.5.2", "2.5.5", "2.5.11"]; $versus = "2.5.2"; foreach ($versions as $version) { printf("%s -v- %s = %s\n", $version, $versus, new_new_version_compare($version, $versus)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/XL7t8
function name:  (null)
number of ops:  17
compiled vars:  !0 = $versions, !1 = $versus, !2 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, '2.5.2'
    9     2      > FE_RESET_R                                       $5      !0, ->15
          3    > > FE_FETCH_R                                               $5, !2, ->15
   10     4    >   INIT_FCALL                                               'printf'
          5        SEND_VAL                                                 '%25s+-v-+%25s+%3D+%25s%0A'
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
          8        INIT_FCALL                                               'new_new_version_compare'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
    9    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $5
   11    16      > RETURN                                                   1

Function new_new_version_compare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XL7t8
function name:  new_new_version_compare
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '.'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '.'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $3      
         10        SPACESHIP                                        ~4      $2, $3
         11      > RETURN                                                   ~4
    5    12*     > RETURN                                                   null

End of function new_new_version_compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.32 ms | 1399 KiB | 18 Q