3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( "Africa" => array( "Egypt" => array( "20" => array( "basicInfo" => array('population' => 663, 'size' => 23) ) ), "Sudan" => array( "249" => array( "basicInfo" => array('population' => 777, 'size' => 45) ) ) ), "Europe" => array( "Greece" => array( "30" => array( "basicInfo" => array('population' => 12345, 'size' => 97) ) ), "Netherlands" => array( "31" => array( "basicInfo" => array('population' => 2222, 'size' => 33) ) ) ) ); $array = array_map(function ($arr) { uasort($arr, function ($a, $b) { return current($b)['basicInfo']['population'] - current($a)['basicInfo']['population']; }); return $arr; }, $array); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvQPm
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   30     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQvQPm%3A30%240'
   35     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
   30     6        ASSIGN                                                   !0, $3
   36     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQvQPm%3A30%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvQPm
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   31     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQvQPm%3A31%241'
   33     4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   34     6      > RETURN                                                   !0
   35     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQvQPm%3A30%240

Function %00%7Bclosure%7D%2Fin%2FQvQPm%3A31%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvQPm
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   32     2        INIT_FCALL                                               'current'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $2      
          5        FETCH_DIM_R                                      ~3      $2, 'basicInfo'
          6        FETCH_DIM_R                                      ~4      ~3, 'population'
          7        INIT_FCALL                                               'current'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        FETCH_DIM_R                                      ~6      $5, 'basicInfo'
         11        FETCH_DIM_R                                      ~7      ~6, 'population'
         12        SUB                                              ~8      ~4, ~7
         13      > RETURN                                                   ~8
   33    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQvQPm%3A31%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.05 ms | 1405 KiB | 21 Q