3v4l.org

run code in 300+ 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:  17
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        INIT_FCALL                                               'trim'
          3        FETCH_DIM_R                                      ~2      !1, 'expiry_date'
          4        FETCH_DIM_R                                      ~3      ~2, 'count'
          5        SEND_VAL                                                 ~3
          6        SEND_VAL                                                 '%28%29'
          7        DO_ICALL                                         $4      
          8        INIT_FCALL                                               'trim'
          9        FETCH_DIM_R                                      ~5      !0, 'expiry_date'
         10        FETCH_DIM_R                                      ~6      ~5, 'count'
         11        SEND_VAL                                                 ~6
         12        SEND_VAL                                                 '%28%29'
         13        DO_ICALL                                         $7      
         14        SUB                                              ~8      $4, $7
         15      > RETURN                                                   ~8
    7    16*     > RETURN                                                   null

End of function sorting_by_count

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.82 ms | 1083 KiB | 16 Q