3v4l.org

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

Function cmp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OH9q1
function name:  cmp
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     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
   14    10*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.22 ms | 1401 KiB | 17 Q