eval.in

Paste #170109

C — GCC 4.4.3, pasted 1 year ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php
$array = array (1=>'aaaaaa',
                      2=>'aa', 3=>'aaaa' , 4=>'a' ,
                      5=>'aa' , 6=>'aaaaaaaaaaaaaaaaaaa'); // آرایه شما
foreach ($array as $key => $val)
{
    $size [$key]  = strlen($val); // قراردادن طول هر المنت در یک آرایه جدید به اسم سایز
}
asort($size); // مرتب کردن نزولی سایز
$size = array_reverse($size , true); // مرتب کردن صعودی سایز
foreach($size as $key => $val)
{
    $new [$key] = $array[$key]; // بازچینی در آرایه جدید به اسم نیو
}
?>
<pre>
<?php
print_r( $new); // نمایش نیو ، استفاده از تگ <pre> نمایش را زیبا تر میکند
?>
</pre>

Program Output

/tmp/execpad-15004c95eccd/source-15004c95eccd:1: error: expected identifier or ‘(’ before ‘<’ token
/tmp/execpad-15004c95eccd/source-15004c95eccd:2:20: warning: character constant too long for its type
/tmp/execpad-15004c95eccd/source-15004c95eccd:3:26: warning: multi-character character constant
/tmp/execpad-15004c95eccd/source-15004c95eccd:3:35: warning: multi-character character constant
/tmp/execpad-15004c95eccd/source-15004c95eccd:4:26: warning: multi-character character constant
/tmp/execpad-15004c95eccd/source-15004c95eccd:4:36: warning: character constant too long for its type
/tmp/execpad-15004c95eccd/source-15004c95eccd:5: error: expected ‘)’ before ‘as’
/tmp/execpad-15004c95eccd/source-15004c95eccd:9: warning: data definition has no type or storage class
/tmp/execpad-15004c95eccd/source-15004c95eccd:9: warning: type defaults to ‘int’ in declaration of ‘asort’
/tmp/execpad-15004c95eccd/source-15004c95eccd:9: warning: parameter names (without types) in function declaration
/tmp/execpad-15004c95eccd/source-15004c95eccd:10: warning: data definition has no type or storage class
/tmp/execpad-15004c95eccd/source-15004c95eccd:10: warning: type defaults to ‘int’ in declaration of ‘$size’
/tmp/execpad-15004c95eccd/source-15004c95eccd:10: warning: implicit declaration of function ‘array_reverse’
/tmp/execpad-15004c95eccd/source-15004c95eccd:10: error: ‘true’ undeclared here (not in a function)
/tmp/execpad-15004c95eccd/source-15004c95eccd:11: error: expected ‘)’ before ‘as’
/tmp/execpad-15004c95eccd/source-15004c95eccd:15: error: expected identifier or ‘(’ before ‘?’ token
/tmp/execpad-15004c95eccd/source-15004c95eccd:19: error: expected identifier or ‘(’ before ‘?’ token

Exited with error status 1

Fork