3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $max_parcelas = 10; $arr = []; $range = range(1,$max_parcelas); $inicial = 2000; $cheio = 2900; $dif = $inicial - $cheio; foreach($range as $x) { $log = log($x, $max_parcelas); $val = $log * $dif; $arr[$x] = ['log' => $log, 'valor' => $val]; } print_r($arr);
based on AhXJL
Output for 5.4.0 - 7.2.0
Array ( [1] => Array ( [log] => 0 [valor] => -0 ) [2] => Array ( [log] => 0.30102999566398 [valor] => -270.92699609758 ) [3] => Array ( [log] => 0.47712125471966 [valor] => -429.4091292477 ) [4] => Array ( [log] => 0.60205999132796 [valor] => -541.85399219517 ) [5] => Array ( [log] => 0.69897000433602 [valor] => -629.07300390242 ) [6] => Array ( [log] => 0.77815125038364 [valor] => -700.33612534528 ) [7] => Array ( [log] => 0.84509804001426 [valor] => -760.58823601283 ) [8] => Array ( [log] => 0.90308998699194 [valor] => -812.78098829275 ) [9] => Array ( [log] => 0.95424250943932 [valor] => -858.81825849539 ) [10] => Array ( [log] => 1 [valor] => -900 ) )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/obZs8 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/obZs8 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/obZs8 on line 4
Process exited with code 255.