3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Proof of Nonsense by Stephan Schmitz @ code.eyecatch-up.de // Complex and inefficient way of a php 'hello world' output function subval_sort($a,$subkey) { foreach($a as $k=>$v) { $b[$k] = strtolower($v[$subkey]); } asort($b); foreach($b as $key=>$val) { $c[] = $a[$key]; } return $c; } $a = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); $p = array('4', '12', '18', '15', '23', '15', '12', '12', '5', '8'); $ls = ''; foreach ($p as $l){ $pa = $l - 1; $ls .= $a[$pa].'|'; } $ls = substr($ls, 0, -1); $ls = explode('|', $ls); $i = count($ls); $o = array(); foreach ($ls as $l){ $o[] = array( 'l' => $l, 'p' => $i ); $i = $i - 1; } $o = subval_sort($o,'p'); $ohw = ''; foreach ($o as $l){ $ohw .= $l['l']; } $oh = substr($ohw, 0, -5); $ow = strrev($ohw); $ow = substr($ow, 0, -5); $ow = strrev($ow); $oh = ucfirst($oh); $ow = ucfirst($ow); echo $oh; echo '&nbsp;'; echo $ow;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 35
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 35
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 47
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 35
Branch analysis from position: 11
filename:       /in/0q15l
function name:  (null)
number of ops:  80
compiled vars:  !0 = $a, !1 = $p, !2 = $ls, !3 = $l, !4 = $pa, !5 = $i, !6 = $o, !7 = $ohw, !8 = $oh, !9 = $ow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   19     2        ASSIGN                                                   !2, ''
   21     3      > FE_RESET_R                                       $13     !1, ->11
          4    > > FE_FETCH_R                                               $13, !3, ->11
   22     5    >   SUB                                              ~14     !3, 1
          6        ASSIGN                                                   !4, ~14
   23     7        FETCH_DIM_R                                      ~16     !0, !4
          8        CONCAT                                           ~17     ~16, '%7C'
          9        ASSIGN_OP                                     8          !2, ~17
   21    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $13
   26    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 -1
         16        DO_ICALL                                         $19     
         17        ASSIGN                                                   !2, $19
   27    18        INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '%7C'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $21     
         22        ASSIGN                                                   !2, $21
   28    23        COUNT                                            ~23     !2
         24        ASSIGN                                                   !5, ~23
   29    25        ASSIGN                                                   !6, <array>
   31    26      > FE_RESET_R                                       $26     !2, ->35
         27    > > FE_FETCH_R                                               $26, !3, ->35
   33    28    >   INIT_ARRAY                                       ~28     !3, 'l'
   34    29        ADD_ARRAY_ELEMENT                                ~28     !5, 'p'
   32    30        ASSIGN_DIM                                               !6
   34    31        OP_DATA                                                  ~28
   36    32        SUB                                              ~29     !5, 1
         33        ASSIGN                                                   !5, ~29
   31    34      > JMP                                                      ->27
         35    >   FE_FREE                                                  $26
   39    36        INIT_FCALL                                               'subval_sort'
         37        SEND_VAR                                                 !6
         38        SEND_VAL                                                 'p'
         39        DO_FCALL                                      0  $31     
         40        ASSIGN                                                   !6, $31
   40    41        ASSIGN                                                   !7, ''
   42    42      > FE_RESET_R                                       $34     !6, ->47
         43    > > FE_FETCH_R                                               $34, !3, ->47
   43    44    >   FETCH_DIM_R                                      ~35     !3, 'l'
         45        ASSIGN_OP                                     8          !7, ~35
   42    46      > JMP                                                      ->43
         47    >   FE_FREE                                                  $34
   46    48        INIT_FCALL                                               'substr'
         49        SEND_VAR                                                 !7
         50        SEND_VAL                                                 0
         51        SEND_VAL                                                 -5
         52        DO_ICALL                                         $37     
         53        ASSIGN                                                   !8, $37
   47    54        INIT_FCALL                                               'strrev'
         55        SEND_VAR                                                 !7
         56        DO_ICALL                                         $39     
         57        ASSIGN                                                   !9, $39
   48    58        INIT_FCALL                                               'substr'
         59        SEND_VAR                                                 !9
         60        SEND_VAL                                                 0
         61        SEND_VAL                                                 -5
         62        DO_ICALL                                         $41     
         63        ASSIGN                                                   !9, $41
   49    64        INIT_FCALL                                               'strrev'
         65        SEND_VAR                                                 !9
         66        DO_ICALL                                         $43     
         67        ASSIGN                                                   !9, $43
   50    68        INIT_FCALL                                               'ucfirst'
         69        SEND_VAR                                                 !8
         70        DO_ICALL                                         $45     
         71        ASSIGN                                                   !8, $45
   51    72        INIT_FCALL                                               'ucfirst'
         73        SEND_VAR                                                 !9
         74        DO_ICALL                                         $47     
         75        ASSIGN                                                   !9, $47
   53    76        ECHO                                                     !8
   54    77        ECHO                                                     '%26nbsp%3B'
   55    78        ECHO                                                     !9
         79      > RETURN                                                   1

Function subval_sort:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 12
filename:       /in/0q15l
function name:  subval_sort
number of ops:  26
compiled vars:  !0 = $a, !1 = $subkey, !2 = $v, !3 = $k, !4 = $b, !5 = $val, !6 = $key, !7 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2      > FE_RESET_R                                       $8      !0, ->12
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->12
          4    >   ASSIGN                                                   !3, ~9
    7     5        INIT_FCALL                                               'strtolower'
          6        FETCH_DIM_R                                      ~12     !2, !1
          7        SEND_VAL                                                 ~12
          8        DO_ICALL                                         $13     
          9        ASSIGN_DIM                                               !4, !3
         10        OP_DATA                                                  $13
    6    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $8
    9    13        INIT_FCALL                                               'asort'
         14        SEND_REF                                                 !4
         15        DO_ICALL                                                 
   10    16      > FE_RESET_R                                       $15     !4, ->23
         17    > > FE_FETCH_R                                       ~16     $15, !5, ->23
         18    >   ASSIGN                                                   !6, ~16
   11    19        FETCH_DIM_R                                      ~19     !0, !6
         20        ASSIGN_DIM                                               !7
         21        OP_DATA                                                  ~19
   10    22      > JMP                                                      ->17
         23    >   FE_FREE                                                  $15
   13    24      > RETURN                                                   !7
   14    25*     > RETURN                                                   null

End of function subval_sort

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.75 ms | 1407 KiB | 26 Q