3v4l.org

run code in 500+ PHP versions simultaneously
<?php $booklist = [ 'Peppa / Season 2 / 43 The Quarrel / Page 1', 'Nursery Rhymes / Wheels On The Bus / Page 1', 'Wonderskills / Starter Book 2 / Unit 1 At The Firehouse / Part 3 / Page 3', 'Oxford Phonics World / Level 2 Short Vowels / Unit 1 Short A / Page 7', 'Peppa / Season 2 / 43 The Quarrel / Page 1', 'Nursery Rhymes / Twinkle Twinkle / Page 1', 'Wonderskills / Starter Book 2 / Unit 1 At The Firehouse / Part 2 / Page 17', 'Oxford Phonics World / Level 1 The Alphabet / Unit 8 / Review W X Y Z / Page 2', 'Peppa / Season 2 / 42 Granny And Grandpas Attic / Page 1', 'Nursery Rhymes / The Phonics Song / Page 1', 'Wonderskills / Starter Book 2 / Unit 1 At The Firehouse / Part 2 / Page 4', 'Peter Pan / Level 1 / Page 1', 'Peppa / Season 2 / 42 Granny And Grandpas Attic / Page 1', 'Nursery Rhymes / The Phonics Song / Page 1', 'Donald Duck / Page 19', 'Donald Duck / Page 18', 'Oxford Phonics World / Level 1 The Alphabet / Unit 8 / Letter Z / Page 2', ]; $result = []; foreach ($booklist as $book) { $result[strtok($book, '/')] ??= $book; } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/GKZXi
function name:  (null)
number of ops:  26
compiled vars:  !0 = $booklist, !1 = $result, !2 = $book
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   23     1        ASSIGN                                                       !1, <array>
   24     2      > FE_RESET_R                                           $5      !0, ->18
          3    > > FE_FETCH_R                                                   $5, !2, ->18
   25     4    >   INIT_FCALL                                                   'strtok'
          5        SEND_VAR                                                     !2
          6        SEND_VAL                                                     '%2F'
          7        DO_ICALL                                             $6      
          8        COPY_TMP                                             $7      $6
          9        FETCH_DIM_IS                                         ~8      !1, $6
         10        COALESCE                                             ~9      ~8
         11        ASSIGN_DIM                                           ~10     !1, $7
         12        OP_DATA                                                      !2
         13        QM_ASSIGN                                            ~9      ~10
         14      > JMP                                                          ->16
         15*       FREE                                                         $7
         16    >   FREE                                                         ~9
   24    17      > JMP                                                          ->3
         18    >   FE_FREE                                                      $5
   27    19        INIT_FCALL                                                   'var_export'
         20        INIT_FCALL                                                   'array_values'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                             $11     
         23        SEND_VAR                                                     $11
         24        DO_ICALL                                                     
         25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.75 ms | 1633 KiB | 15 Q