3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scores = array( "Johnny" => array(07, 07, 00, 03, 00, 04, 00, 01, 01, 04, 03), "Mike" => array(04, 03, 00, 07, 04, 07, 00, 01, 00, 07, 04), "Will" => array(03, 04, 00, 03, 04, 07, 00, 01, 00, 07, 04), "Kyle" => array(07, 01, 00, 03, 04, 01, 00, 07, 03, 04, 04), "Vasques" => array(03, 01, 00, 03, 04, 07, 00, 01, 00, 07, 07) ); function cmp($a, $b) { return array_sum($b) - array_sum($a); } usort($scores, "cmp"); //start loop for rows foreach($scores as $key=>$value) { echo array_sum($value) . "<br />"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/HWDKe
function name:  (null)
number of ops:  16
compiled vars:  !0 = $scores, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'cmp'
          4        DO_ICALL                                                 
   17     5      > FE_RESET_R                                       $5      !0, ->14
          6    > > FE_FETCH_R                                       ~6      $5, !1, ->14
          7    >   ASSIGN                                                   !2, ~6
   18     8        INIT_FCALL                                               'array_sum'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        CONCAT                                           ~9      $8, '%3Cbr+%2F%3E'
         12        ECHO                                                     ~9
   17    13      > JMP                                                      ->6
         14    >   FE_FREE                                                  $5
   19    15      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HWDKe
function name:  cmp
number of ops:  11
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        INIT_FCALL                                               'array_sum'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $2      
          5        INIT_FCALL                                               'array_sum'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SUB                                              ~4      $2, $3
          9      > RETURN                                                   ~4
   13    10*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.29 ms | 1388 KiB | 17 Q