3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayA = [ 'a' => '150', 'b' => '200', 'c' => '300', 'd' => '1000', 'e' => '350', 'f' => '1000' ]; $arrayB = [ 'a' => '500', 'b' => '400', 'd' => '1000', 'f' => '1000' ]; $arrayC = []; foreach($arrayA as $keyA => $valueA) { if (array_key_exists($keyA, $arrayB)) { $arrayC[$keyA] = floor((($arrayB[$keyA] - $valueA) / $valueA ) * 100) . "%"; continue; } $arrayC[$keyA] = "No match"; } print_r($arrayC);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [a] => 233% [b] => 100% [c] => No match [d] => 0% [e] => No match [f] => 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:
127.24 ms | 405 KiB | 5 Q