3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[] = array('title' => 'hello', 'attributes' => array('id' => 4, 'startdate' => '2013-06-11')); $data[] = array('title' => 'hello second entry', 'attributes' => array('id' => 6, 'startdate' => '2013-04-11')); print "Inital Data\n"; print_r($data); print "\n"; usort($array, function($a, $b) { if ($a['attributes']['startdate'] > $b['attributes']['startdate']) return 1; if ($a['attributes']['startdate'] < $b['attributes']['startdate']) return -1; return 0; }); print "Sorted Data\n"; print_r($data); print "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPbfL
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    7     4        ECHO                                                     'Inital+Data%0A'
    8     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    9     8        ECHO                                                     '%0A'
   11     9        INIT_FCALL                                               'usort'
         10        SEND_REF                                                 !1
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FfPbfL%3A11%240'
   15    12        SEND_VAL                                                 ~5
         13        DO_ICALL                                                 
   19    14        ECHO                                                     'Sorted+Data%0A'
   20    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   21    18        ECHO                                                     '%0A'
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FfPbfL%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPbfL
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        FETCH_DIM_R                                      ~2      !0, 'attributes'
          3        FETCH_DIM_R                                      ~3      ~2, 'startdate'
          4        FETCH_DIM_R                                      ~4      !1, 'attributes'
          5        FETCH_DIM_R                                      ~5      ~4, 'startdate'
          6        IS_SMALLER                                               ~5, ~3
          7      > JMPZ                                                     ~6, ->9
          8    > > RETURN                                                   1
   13     9    >   FETCH_DIM_R                                      ~7      !0, 'attributes'
         10        FETCH_DIM_R                                      ~8      ~7, 'startdate'
         11        FETCH_DIM_R                                      ~9      !1, 'attributes'
         12        FETCH_DIM_R                                      ~10     ~9, 'startdate'
         13        IS_SMALLER                                               ~8, ~10
         14      > JMPZ                                                     ~11, ->16
         15    > > RETURN                                                   -1
   14    16    > > RETURN                                                   0
   15    17*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfPbfL%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.93 ms | 945 KiB | 18 Q