3v4l.org

run code in 500+ PHP versions simultaneously
<?php function sort_subnets($x, $y){ $x_arr = explode('.', $x); $y_arr = explode('.', $y); return $x_arr <=> $y_arr; } $subnet_list = array('192.169.12', '192.167.11', '192.169.14', '192.168.13', '192.167.12', '122.169.15', '192.167.16' ); usort($subnet_list, 'sort_subnets'); print_r($subnet_list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iFGrp
function name:  (null)
number of ops:  9
compiled vars:  !0 = $subnet_list
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                       !0, <array>
   17     1        INIT_FCALL                                                   'usort'
          2        SEND_REF                                                     !0
          3        SEND_VAL                                                     'sort_subnets'
          4        DO_ICALL                                                     
   18     5        INIT_FCALL                                                   'print_r'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                                     
          8      > RETURN                                                       1

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

End of function sort_subnets

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
214.77 ms | 2578 KiB | 16 Q