3v4l.org

run code in 500+ PHP versions simultaneously
<?php $myWondersArray = array ( 0 => (object) array( 'currentUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 3 - Helping Mom (Part 1/3)', 'currentUnitPart' => 'wonderskills/starter_book_2/unit_3_helping_mom/part_1/', ), 1 => (object) array( 'currentUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 3 - Helping Mom (Part 2/3)', 'currentUnitPart' => 'wonderskills/starter_book_2/unit_3_helping_mom/part_2/', ), 2 => (object) array( 'currentUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 3 - Helping Mom (Part 3/3)', 'currentUnitPart' => 'wonderskills/starter_book_2/unit_3_helping_mom/part_3/', ), 3 => (object) array( 'previousUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 2 - Sid\'s New Neighbors (Part 1/3)', 'previousUnitPart' => 'wonderskills/starter_book_2/unit_2_sids_new_neighbors/part_1/', ), 4 => (object) array( 'previousUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 2 - Sid\'s New Neighbors (Part 2/3)', 'previousUnitPart' => 'wonderskills/starter_book_2/unit_2_sids_new_neighbors/part_2/', ), 5 => (object) array( 'previousUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 2 - Sid\'s New Neighbors (Part 3/3)', 'previousUnitPart' => 'wonderskills/starter_book_2/unit_2_sids_new_neighbors/part_3/', ), 6 => (object) array( 'nextUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 4 - Food from the Garden (Part 1/3)', 'nextUnitPart' => 'wonderskills/starter_book_2/unit_4_food_from_the_garden/part_1/', ), 7 => (object) array( 'nextUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 4 - Food from the Garden (Part 2/3)', 'nextUnitPart' => 'wonderskills/starter_book_2/unit_4_food_from_the_garden/part_2/', ), 8 => (object) array( 'nextUnitDisplay' => 'WonderSkills: Starter Book 2, Unit 4 - Food from the Garden (Part 3/3)', 'nextUnitPart' => 'wonderskills/starter_book_2/unit_4_food_from_the_garden/part_3/', ), ); $priorities = array_flip(['prev', 'curr', 'next']); array_multisort( array_map(fn($obj) => $priorities[substr(key((array) $obj), 0, 4)] ?? PHP_INT_MAX, $myWondersArray), $myWondersArray ); var_export($myWondersArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSqHP
function name:  (null)
number of ops:  37
compiled vars:  !0 = $myWondersArray, !1 = $priorities
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   CAST                                              8  ~2      <array>
          1        INIT_ARRAY                                           ~3      ~2, 0
          2        CAST                                              8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                    ~3      ~4, 1
          4        CAST                                              8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                    ~3      ~5, 2
          6        CAST                                              8  ~6      <array>
          7        ADD_ARRAY_ELEMENT                                    ~3      ~6, 3
          8        CAST                                              8  ~7      <array>
          9        ADD_ARRAY_ELEMENT                                    ~3      ~7, 4
         10        CAST                                              8  ~8      <array>
         11        ADD_ARRAY_ELEMENT                                    ~3      ~8, 5
         12        CAST                                              8  ~9      <array>
         13        ADD_ARRAY_ELEMENT                                    ~3      ~9, 6
         14        CAST                                              8  ~10     <array>
         15        ADD_ARRAY_ELEMENT                                    ~3      ~10, 7
         16        CAST                                              8  ~11     <array>
         17        ADD_ARRAY_ELEMENT                                    ~3      ~11, 8
    3    18        ASSIGN                                                       !0, ~3
   51    19        INIT_FCALL                                                   'array_flip'
         20        SEND_VAL                                                     <array>
         21        DO_ICALL                                             $13     
         22        ASSIGN                                                       !1, $13
   52    23        INIT_FCALL                                                   'array_multisort'
   53    24        INIT_FCALL                                                   'array_map'
         25        DECLARE_LAMBDA_FUNCTION                              ~15     [0]
         26        BIND_LEXICAL                                                 ~15, !1
         27        SEND_VAL                                                     ~15
         28        SEND_VAR                                                     !0
         29        DO_ICALL                                             $16     
         30        SEND_VAL                                                     $16
   54    31        SEND_REF                                                     !0
   52    32        DO_ICALL                                                     
   56    33        INIT_FCALL                                                   'var_export'
         34        SEND_VAR                                                     !0
         35        DO_ICALL                                                     
         36      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSqHP
function name:  {closure:/in/XSqHP:53}
number of ops:  13
compiled vars:  !0 = $obj, !1 = $priorities
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   53     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        INIT_FCALL                                                   'key'
          3        CAST                                              7  ~2      !0
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                             $3      
          6        FRAMELESS_ICALL_3                substr              ~4      $3, 0
          7        OP_DATA                                                      4
          8        FETCH_DIM_IS                                         ~5      !1, ~4
          9        COALESCE                                             ~6      ~5
         10        QM_ASSIGN                                            ~6      9223372036854775807
         11      > RETURN                                                       ~6
         12*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.43 ms | 1847 KiB | 18 Q