<?php
function sortByDate($a, $b) {
return strtotime($a) > strtotime($b);
}
$cont_history = Array (
'20-02-2015' => Array ( 'activity' => 'GATE IN', 'by' => '', 'location' => 'COLOMBO', 'depot' => 'CNLS' ),
'15-03-2015' => Array ( 'activity' => 'GATE OUT', 'by' => '', 'location' => 'COLOMBO', 'depot' => 'CNLS' ),
'18-03-2015' => Array ( 'activity' => 'GATE IN', 'by' => '', 'location' => 'CHENNAI', 'depot' => 'GOBAL'),
'05-04-2015' => Array ( 'activity' => 'GATE OUT', 'by' => '', 'location' => 'CHENNAI', 'depot' => 'GOBAL'),
'10-04-2015' => Array ( 'activity' => 'GATE IN', 'by' => '', 'location' => 'MUMBAI', 'depot' => 'CONS' ),
'13-05-2015' => Array ( 'activity' => 'GATE OUT', 'by' => '', 'location' => 'MUMBAI', 'depot' => 'CONS' ),
'10-02-2015' => Array ( 'activity' => 'Container Bought', 'by' => 'CARU', 'location' => 'COLOMBO', 'depot' => 'CNLS' ),
'07-05-2015' => Array ( 'activity' => 'Container Sold', 'by' => 'TCPL', 'location' => 'MUMBAI', 'depot' => 'CONS' )
);
uksort($cont_history, 'sortByDate');
print_r($cont_history);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/33RZg
function name: (null)
number of ops: 9
compiled vars: !0 = $cont_history
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
7 0 E > ASSIGN !0, <array>
18 1 INIT_FCALL 'uksort'
2 SEND_REF !0
3 SEND_VAL 'sortByDate'
4 DO_ICALL
20 5 INIT_FCALL 'print_r'
6 SEND_VAR !0
7 DO_ICALL
8 > RETURN 1
Function sortbydate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/33RZg
function name: sortByDate
number of ops: 11
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 'strtotime'
3 SEND_VAR !0
4 DO_ICALL $2
5 INIT_FCALL 'strtotime'
6 SEND_VAR !1
7 DO_ICALL $3
8 IS_SMALLER ~4 $3, $2
9 > RETURN ~4
5 10* > RETURN null
End of function sortbydate
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
139.1 ms | 999 KiB | 16 Q