3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); ini_set('display_errors', TRUE); $loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); date_default_timezone_set('Europe/Berlin'); $string = "B 20:15, H 21:00, H 21:00, H 21:15, M 22:30, H 21:30, R 00:00, R 23:30, M 22:30, M 22:45, M 22:45, H 21:30, R 23:35"; $ergebnis = explode(", ", $string); asort($ergebnis); $ergebnis1 = array_unique($ergebnis, SORT_STRING); $string_neu = ""; foreach($ergebnis1 AS $a){ if (!strpos($string_neu, substr($a, 0, 1))) { $string_neu .= $a .', '; } } echo substr($string_neu, 0, -2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 49
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 49
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 48
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/dvDDd
function name:  (null)
number of ops:  57
compiled vars:  !0 = $loc_de, !1 = $string, !2 = $ergebnis, !3 = $ergebnis1, !4 = $string_neu, !5 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'setlocale'
          8        SEND_VAL                                                 6
          9        SEND_VAL                                                 'de_DE%40euro'
         10        SEND_VAL                                                 'de_DE'
         11        SEND_VAL                                                 'de'
         12        SEND_VAL                                                 'ge'
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !0, $8
    6    15        INIT_FCALL                                               'date_default_timezone_set'
         16        SEND_VAL                                                 'Europe%2FBerlin'
         17        DO_ICALL                                                 
    8    18        ASSIGN                                                   !1, 'B+20%3A15%2C+H+21%3A00%2C+H+21%3A00%2C+H+21%3A15%2C+M+22%3A30%2C+H+21%3A30%2C+R+00%3A00%2C+R+23%3A30%2C+M+22%3A30%2C+M+22%3A45%2C+M+22%3A45%2C+H+21%3A30%2C+R+23%3A35'
    9    19        INIT_FCALL                                               'explode'
         20        SEND_VAL                                                 '%2C+'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !2, $12
   11    24        INIT_FCALL                                               'asort'
         25        SEND_REF                                                 !2
         26        DO_ICALL                                                 
   12    27        INIT_FCALL                                               'array_unique'
         28        SEND_VAR                                                 !2
         29        SEND_VAL                                                 2
         30        DO_ICALL                                         $15     
         31        ASSIGN                                                   !3, $15
   14    32        ASSIGN                                                   !4, ''
   15    33      > FE_RESET_R                                       $18     !3, ->49
         34    > > FE_FETCH_R                                               $18, !5, ->49
   16    35    >   INIT_FCALL                                               'strpos'
         36        SEND_VAR                                                 !4
         37        INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !5
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 1
         41        DO_ICALL                                         $19     
         42        SEND_VAR                                                 $19
         43        DO_ICALL                                         $20     
         44        BOOL_NOT                                         ~21     $20
         45      > JMPZ                                                     ~21, ->48
   17    46    >   CONCAT                                           ~22     !5, '%2C+'
         47        ASSIGN_OP                                     8          !4, ~22
   15    48    > > JMP                                                      ->34
         49    >   FE_FREE                                                  $18
   21    50        INIT_FCALL                                               'substr'
         51        SEND_VAR                                                 !4
         52        SEND_VAL                                                 0
         53        SEND_VAL                                                 -2
         54        DO_ICALL                                         $24     
         55        ECHO                                                     $24
         56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.84 ms | 1014 KiB | 22 Q