3v4l.org

run code in 500+ PHP versions simultaneously
<?php $words=['MVW','MWAH','MWAH','MYW','MW','MY9AH','MYQAH','MYQAH','MY9AH','MYQAH', 'MYQAH','MWAH','MYQAH','MYSWI','MYQAH','MYQAH','MW','MW','MW','MW']; echo "*** Step #1: Replace each word with an array of its characters ***\n"; var_export(array_map('str_split',$words)); echo "\n\n---\n\n"; echo "*** Step #2: Pass the characters through array_map with the splat operator and func_get_args() to isolate columnar data including NULLs where no character exists in the column ***\n"; var_export(array_map(function(){return func_get_args();},...array_map('str_split',$words))); echo "\n\n---\n\n"; echo "*** Step #3: Convert column data to strings with the added benefit of eliminating NULLs ***\n"; //var_export(array_map(function(){return implode(func_get_args());},...array_map('str_split',$words))); echo "\n\n---\n\n"; echo "*** Step #4: Count the occurrences of each character; stored as ord values as keys, and occurrences as values ***\n"; var_export(array_map(function(){return count_chars(implode(func_get_args()),1);},...array_map('str_split',$words))); echo "\n\n---\n\n"; echo "*** Step #5: Sort DESC while preserving keys ***\n"; var_export(array_map(function(){$occurrences=count_chars(implode(func_get_args()),1); arsort($occurrences); return $occurrences;},...array_map('str_split',$words))); echo "\n\n---\n\n"; echo "*** Step #6: Target the first (highest occurring) value/character in the array ***\n"; var_export(array_map(function(){$occurrences=count_chars(implode(func_get_args()),1); arsort($occurrences); return key($occurrences);},...array_map('str_split',$words))); echo "\n\n---\n\n"; echo "*** Step #7: Convert the targeted character from ord() to chr() ***\n"; var_export(array_map(function(){$occurrences=count_chars(implode(func_get_args()),1); arsort($occurrences); return chr(key($occurrences));},...array_map('str_split',$words)));

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WAOvW
function name:  (null)
number of ops:  87
compiled vars:  !0 = $words
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    5     1        ECHO                                                         '%2A%2A%2A+Step+%231%3A++Replace+each+word+with+an+array+of+its+characters+%2A%2A%2A%0A'
    6     2        INIT_FCALL                                                   'var_export'
          3        INIT_FCALL                                                   'array_map'
          4        SEND_VAL                                                     'str_split'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $2      
          7        SEND_VAR                                                     $2
          8        DO_ICALL                                                     
    7     9        ECHO                                                         '%0A%0A---%0A%0A'
    9    10        ECHO                                                         '%2A%2A%2A+Step+%232%3A++Pass+the+characters+through+array_map+with+the+splat+operator+and+func_get_args%28%29+to+isolate+columnar+data+including+NULLs+where+no+character+exists+in+the+column+%2A%2A%2A%0A'
   10    11        INIT_FCALL                                                   'var_export'
         12        INIT_FCALL                                                   'array_map'
         13        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
         14        SEND_VAL                                                     ~4
         15        INIT_FCALL                                                   'array_map'
         16        SEND_VAL                                                     'str_split'
         17        SEND_VAR                                                     !0
         18        DO_ICALL                                             $5      
         19        SEND_UNPACK                                                  $5
         20        CHECK_UNDEF_ARGS                                             
         21        DO_ICALL                                             $6      
         22        SEND_VAR                                                     $6
         23        DO_ICALL                                                     
   11    24        ECHO                                                         '%0A%0A---%0A%0A'
   13    25        ECHO                                                         '%2A%2A%2A+Step+%233%3A++Convert+column+data+to+strings+with+the+added+benefit+of+eliminating+NULLs+%2A%2A%2A%0A'
   15    26        ECHO                                                         '%0A%0A---%0A%0A'
   17    27        ECHO                                                         '%2A%2A%2A+Step+%234%3A++Count+the+occurrences+of+each+character%3B+stored+as+ord+values+as+keys%2C+and+occurrences+as+values+%2A%2A%2A%0A'
   18    28        INIT_FCALL                                                   'var_export'
         29        INIT_FCALL                                                   'array_map'
         30        DECLARE_LAMBDA_FUNCTION                              ~8      [1]
         31        SEND_VAL                                                     ~8
         32        INIT_FCALL                                                   'array_map'
         33        SEND_VAL                                                     'str_split'
         34        SEND_VAR                                                     !0
         35        DO_ICALL                                             $9      
         36        SEND_UNPACK                                                  $9
         37        CHECK_UNDEF_ARGS                                             
         38        DO_ICALL                                             $10     
         39        SEND_VAR                                                     $10
         40        DO_ICALL                                                     
   19    41        ECHO                                                         '%0A%0A---%0A%0A'
   21    42        ECHO                                                         '%2A%2A%2A+Step+%235%3A++Sort+DESC+while+preserving+keys+%2A%2A%2A%0A'
   22    43        INIT_FCALL                                                   'var_export'
         44        INIT_FCALL                                                   'array_map'
         45        DECLARE_LAMBDA_FUNCTION                              ~12     [2]
         46        SEND_VAL                                                     ~12
         47        INIT_FCALL                                                   'array_map'
         48        SEND_VAL                                                     'str_split'
         49        SEND_VAR                                                     !0
         50        DO_ICALL                                             $13     
         51        SEND_UNPACK                                                  $13
         52        CHECK_UNDEF_ARGS                                             
         53        DO_ICALL                                             $14     
         54        SEND_VAR                                                     $14
         55        DO_ICALL                                                     
   23    56        ECHO                                                         '%0A%0A---%0A%0A'
   25    57        ECHO                                                         '%2A%2A%2A+Step+%236%3A++Target+the+first+%28highest+occurring%29+value%2Fcharacter+in+the+array+%2A%2A%2A%0A'
   26    58        INIT_FCALL                                                   'var_export'
         59        INIT_FCALL                                                   'array_map'
         60        DECLARE_LAMBDA_FUNCTION                              ~16     [3]
         61        SEND_VAL                                                     ~16
         62        INIT_FCALL                                                   'array_map'
         63        SEND_VAL                                                     'str_split'
         64        SEND_VAR                                                     !0
         65        DO_ICALL                                             $17     
         66        SEND_UNPACK                                                  $17
         67        CHECK_UNDEF_ARGS                                             
         68        DO_ICALL                                             $18     
         69        SEND_VAR                                                     $18
         70        DO_ICALL                                                     
   27    71        ECHO                                                         '%0A%0A---%0A%0A'
   29    72        ECHO                                                         '%2A%2A%2A+Step+%237%3A++Convert+the+targeted+character+from+ord%28%29+to+chr%28%29+%2A%2A%2A%0A'
   30    73        INIT_FCALL                                                   'var_export'
         74        INIT_FCALL                                                   'array_map'
         75        DECLARE_LAMBDA_FUNCTION                              ~20     [4]
         76        SEND_VAL                                                     ~20
         77        INIT_FCALL                                                   'array_map'
         78        SEND_VAL                                                     'str_split'
         79        SEND_VAR                                                     !0
         80        DO_ICALL                                             $21     
         81        SEND_UNPACK                                                  $21
         82        CHECK_UNDEF_ARGS                                             
         83        DO_ICALL                                             $22     
         84        SEND_VAR                                                     $22
         85        DO_ICALL                                                     
         86      > 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/WAOvW
function name:  {closure:/in/WAOvW:10}
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   FUNC_GET_ARGS                                        ~0      
          1      > RETURN                                                       ~0
          2*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WAOvW
function name:  {closure:/in/WAOvW:18}
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                                   'count_chars'
          1        FUNC_GET_ARGS                                        ~0      
          2        FRAMELESS_ICALL_1                implode             ~1      ~0
          3        SEND_VAL                                                     ~1
          4        SEND_VAL                                                     1
          5        DO_ICALL                                             $2      
          6      > RETURN                                                       $2
          7*     > RETURN                                                       null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WAOvW
function name:  {closure:/in/WAOvW:22}
number of ops:  12
compiled vars:  !0 = $occurrences
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                                   'count_chars'
          1        FUNC_GET_ARGS                                        ~1      
          2        FRAMELESS_ICALL_1                implode             ~2      ~1
          3        SEND_VAL                                                     ~2
          4        SEND_VAL                                                     1
          5        DO_ICALL                                             $3      
          6        ASSIGN                                                       !0, $3
          7        INIT_FCALL                                                   'arsort'
          8        SEND_REF                                                     !0
          9        DO_ICALL                                                     
         10      > RETURN                                                       !0
         11*     > RETURN                                                       null

End of Dynamic Function 2

Dynamic Function 3
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WAOvW
function name:  {closure:/in/WAOvW:26}
number of ops:  15
compiled vars:  !0 = $occurrences
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                                   'count_chars'
          1        FUNC_GET_ARGS                                        ~1      
          2        FRAMELESS_ICALL_1                implode             ~2      ~1
          3        SEND_VAL                                                     ~2
          4        SEND_VAL                                                     1
          5        DO_ICALL                                             $3      
          6        ASSIGN                                                       !0, $3
          7        INIT_FCALL                                                   'arsort'
          8        SEND_REF                                                     !0
          9        DO_ICALL                                                     
         10        INIT_FCALL                                                   'key'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                             $6      
         13      > RETURN                                                       $6
         14*     > RETURN                                                       null

End of Dynamic Function 3

Dynamic Function 4
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WAOvW
function name:  {closure:/in/WAOvW:30}
number of ops:  18
compiled vars:  !0 = $occurrences
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                                   'count_chars'
          1        FUNC_GET_ARGS                                        ~1      
          2        FRAMELESS_ICALL_1                implode             ~2      ~1
          3        SEND_VAL                                                     ~2
          4        SEND_VAL                                                     1
          5        DO_ICALL                                             $3      
          6        ASSIGN                                                       !0, $3
          7        INIT_FCALL                                                   'arsort'
          8        SEND_REF                                                     !0
          9        DO_ICALL                                                     
         10        INIT_FCALL                                                   'chr'
         11        INIT_FCALL                                                   'key'
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                             $6      
         14        SEND_VAR                                                     $6
         15        DO_ICALL                                             $7      
         16      > RETURN                                                       $7
         17*     > RETURN                                                       null

End of Dynamic Function 4

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
208.99 ms | 3145 KiB | 19 Q