3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_0 = [ ['firstName' => 'Zoe', 'lastName' => 'Black', 'age' => 32, 'sex' => 'Female'], ['firstName' => 'Alex', 'lastName' => 'Katter', 'age' => 24, 'sex' => 'Male'], ['firstName' => 'Daniel', 'lastName' => 'Farmer', 'age' => 54, 'sex' => 'Male'], ['firstName' => 'Casy', 'lastName' => 'Denali', 'age' => 26, 'sex' => 'Female'], ['firstName' => 'Dave', 'lastName' => 'Desopolous', 'age' => 21, 'sex' => 'Male'], ['firstName' => 'Hugo', 'lastName' => 'Tesserat', 'age' => 43, 'sex' => 'Male'], ['firstName' => 'Sandy', 'lastName' => 'Williams', 'age' => 34, 'sex' => 'Female'], ['firstName' => 'Beth', 'lastName' => 'Baronksy', 'age' => 39, 'sex' => 'Female'], ['firstName' => 'David', 'lastName' => 'Faller', 'age' => 63, 'sex' => 'Male'], ['firstName' => 'Daniel', 'lastName' => 'Dekresta', 'age' => 32, 'sex' => 'Male'] ]; $orderBy_0 = function ($i) { return $i['firstName']; }; $orderBy_1 = function ($i) { return $i['lastName']; }; $t = function & () use ($array_0, $orderBy_0, $orderBy_1) { $projected_0 = []; $projected_1 = []; $elements_0 = []; $elements_0 = []; foreach($array_0 as $key_1 => &$value_1) { $keyHash_0 = \Pinq\Iterators\Common\Identity::hash($key_1); $keyMap_0[$keyHash_0] = $key_1; $projected_0[$keyHash_0] = $orderBy_0($value_1, $key_1); $projected_1[$keyHash_0] = $orderBy_1($value_1, $key_1); $elements_0[$keyHash_0] =& $value_1; unset($value_1); } foreach($elements_0 as $keyHash_0 => &$value_0) { $key_0 = $keyMap_0[$keyHash_0]; yield $key_0 => $value_0; unset($value_0); } }; var_dump(iterator_to_array($t(), true));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiFdc
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array_0, !1 = $orderBy_0, !2 = $orderBy_1, !3 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   17     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQiFdc%3A17%240'
          2        ASSIGN                                                   !1, ~5
   18     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQiFdc%3A18%241'
          4        ASSIGN                                                   !2, ~7
   20     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQiFdc%3A20%242'
          6        BIND_LEXICAL                                             ~9, !0
          7        BIND_LEXICAL                                             ~9, !1
          8        BIND_LEXICAL                                             ~9, !2
          9        ASSIGN                                                   !3, ~9
   41    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'iterator_to_array'
         12        INIT_DYNAMIC_CALL                                        !3
         13        DO_FCALL                                      0  $11     
         14        SEND_VAR                                                 $11
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $12     
         17        SEND_VAR                                                 $12
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQiFdc%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiFdc
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'firstName'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQiFdc%3A17%240

Function %00%7Bclosure%7D%2Fin%2FQiFdc%3A18%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiFdc
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'lastName'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQiFdc%3A18%241

Function %00%7Bclosure%7D%2Fin%2FQiFdc%3A20%242:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 9, Position 2 = 33
Branch analysis from position: 9
2 jumps found. (Code = 126) Position 1 = 10, Position 2 = 33
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 33
2 jumps found. (Code = 125) Position 1 = 35, Position 2 = 42
Branch analysis from position: 35
2 jumps found. (Code = 126) Position 1 = 36, Position 2 = 42
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 42
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 33
filename:       /in/QiFdc
function name:  {closure}
number of ops:  44
compiled vars:  !0 = $array_0, !1 = $orderBy_0, !2 = $orderBy_1, !3 = $projected_0, !4 = $projected_1, !5 = $elements_0, !6 = $value_1, !7 = $key_1, !8 = $keyHash_0, !9 = $keyMap_0, !10 = $value_0, !11 = $key_0
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   GENERATOR_CREATE                                         
          1        BIND_STATIC                                              !0
          2        BIND_STATIC                                              !1
          3        BIND_STATIC                                              !2
   21     4        ASSIGN                                                   !3, <array>
   22     5        ASSIGN                                                   !4, <array>
   23     6        ASSIGN                                                   !5, <array>
   24     7        ASSIGN                                                   !5, <array>
   25     8      > FE_RESET_RW                                      $16     !0, ->33
          9    > > FE_FETCH_RW                                      ~17     $16, !6, ->33
         10    >   ASSIGN                                                   !7, ~17
   26    11        INIT_STATIC_METHOD_CALL                                  'Pinq%5CIterators%5CCommon%5CIdentity', 'hash'
         12        SEND_VAR_EX                                              !7
         13        DO_FCALL                                      0  $19     
         14        ASSIGN                                                   !8, $19
   27    15        ASSIGN_DIM                                               !9, !8
         16        OP_DATA                                                  !7
   28    17        INIT_DYNAMIC_CALL                                        !1
         18        SEND_VAR_EX                                              !6
         19        SEND_VAR_EX                                              !7
         20        DO_FCALL                                      0  $23     
         21        ASSIGN_DIM                                               !3, !8
         22        OP_DATA                                                  $23
   29    23        INIT_DYNAMIC_CALL                                        !2
         24        SEND_VAR_EX                                              !6
         25        SEND_VAR_EX                                              !7
         26        DO_FCALL                                      0  $25     
         27        ASSIGN_DIM                                               !4, !8
         28        OP_DATA                                                  $25
   30    29        FETCH_DIM_W                                      $26     !5, !8
         30        ASSIGN_REF                                               $26, !6
   31    31        UNSET_CV                                                 !6
   25    32      > JMP                                                      ->9
         33    >   FE_FREE                                                  $16
   33    34      > FE_RESET_RW                                      $28     !5, ->42
         35    > > FE_FETCH_RW                                      ~29     $28, !10, ->42
         36    >   ASSIGN                                                   !8, ~29
   34    37        FETCH_DIM_R                                      ~31     !9, !8
         38        ASSIGN                                                   !11, ~31
   35    39        YIELD                                                    !10, !11
   36    40        UNSET_CV                                                 !10
   33    41      > JMP                                                      ->35
         42    >   FE_FREE                                                  $28
   39    43      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FQiFdc%3A20%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.83 ms | 1404 KiB | 17 Q