3v4l.org

run code in 300+ PHP versions simultaneously
<?php $context = [ 'total_pedidos' => '211,10', 'valor_credito' => '31,80', 'valor_debito' => '49,90', 'valor_dinheiro' => '129,40' ]; foreach ($context as $key => $valor) { $valor = str_replace('.', '', $valor); $valor = str_replace(',', '.', $valor); $context[$key] = number_format($valor, 2) * 100; } $total = $context['total_pedidos'] - ($context['valor_credito'] + $context['valor_debito'] + $context['valor_dinheiro']); $total = $total / 100; var_dump($total);
Output for git.master, git.master_jit, rfc.property-hooks
float(0)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.21 ms | 401 KiB | 8 Q