3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( Array( "2014-05-31" => "value1" ), Array ( "2014-04-17" => "value2" ), Array ( "2014-04-21" => "value 3" ) ); $res = usort($arr, function($a, $b){ $a_time = array_keys($a); $par1 = strtotime($a_time[0]); $b_time = array_keys($b); $par2 = strtotime($b_time[0]); if ($par1 == $par2) { return 0; } return ($par1 < $par2) ? -1 : 1; }); print_r($arr); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3fRbP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3fRbP%3A13%240'
   22     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
   13     6        ASSIGN                                                   !1, $4
   23     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   25    10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3fRbP%3A13%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3fRbP
function name:  {closure}
number of ops:  30
compiled vars:  !0 = $a, !1 = $b, !2 = $a_time, !3 = $par1, !4 = $b_time, !5 = $par2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_FCALL                                               'array_keys'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   15     6        INIT_FCALL                                               'strtotime'
          7        FETCH_DIM_R                                      ~8      !2, 0
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !3, $9
   16    11        INIT_FCALL                                               'array_keys'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !4, $11
   17    15        INIT_FCALL                                               'strtotime'
         16        FETCH_DIM_R                                      ~13     !4, 0
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                         $14     
         19        ASSIGN                                                   !5, $14
   18    20        IS_EQUAL                                                 !3, !5
         21      > JMPZ                                                     ~16, ->23
   19    22    > > RETURN                                                   0
   21    23    >   IS_SMALLER                                               !3, !5
         24      > JMPZ                                                     ~17, ->27
         25    >   QM_ASSIGN                                        ~18     -1
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~18     1
         28    > > RETURN                                                   ~18
   22    29*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3fRbP%3A13%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.15 ms | 1392 KiB | 21 Q