3v4l.org

run code in 500+ PHP versions simultaneously
<?php // this $b-$a is for desc, for asc try $a-$b function sorting_by_count($a, $b) { return trim($b['expiry_date']['count'],'()') - trim($a['expiry_date']['count'],'()'); } $array = [ [ 'certificate_name' => 'track.site', 'domains' => 'track.site', 'expiry_date' => [ 'date' => '2018-09-25', 'time' => '10:11:58', 'count' => '(22)', ] ], [ 'certificate_name' => 'stats.com', 'domains' => 'stats.com', 'expiry_date' => [ 'date' => '2018-09-24', 'time' => '10:11:58', 'count' => '(43)', ] ] ]; usort($array, 'sorting_by_count'); print_r($array); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vtRIu
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                       !0, <array>
   28     1        INIT_FCALL                                                   'usort'
          2        SEND_REF                                                     !0
          3        SEND_VAL                                                     'sorting_by_count'
          4        DO_ICALL                                                     
   29     5        INIT_FCALL                                                   'print_r'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                                     
   30     8      > RETURN                                                       1

Function sorting_by_count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vtRIu
function name:  sorting_by_count
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    6     2        FETCH_DIM_R                                          ~2      !1, 'expiry_date'
          3        FETCH_DIM_R                                          ~3      ~2, 'count'
          4        FRAMELESS_ICALL_2                trim                ~4      ~3, '%28%29'
          5        FETCH_DIM_R                                          ~5      !0, 'expiry_date'
          6        FETCH_DIM_R                                          ~6      ~5, 'count'
          7        FRAMELESS_ICALL_2                trim                ~7      ~6, '%28%29'
          8        SUB                                                  ~8      ~4, ~7
          9      > RETURN                                                       ~8
    7    10*     > RETURN                                                       null

End of function sorting_by_count

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.91 ms | 2767 KiB | 15 Q