3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = array ( 0 => array ( 'id' => 1, 'location' => 3, 'location_fees' => 3, 'gross_percentage' => 25, 'transaction_percentage' => 0, 'user_name' => 'admin', 'user_id' => 1, 'gross' => 'yes', 'transaction' => 'no' ), 1 => array ( 'id' => 2, 'location' => 5, 'location_fees' => 5, 'gross_percentage' => 0, 'transaction_percentage' => 24, 'user_name' => 'admin', 'user_id' => 1, 'gross' => 'no', 'transaction' => 'yes' ), 2 => array ( 'id' => 3, 'location' => 2, 'location_fees' => 5, 'gross_percentage' => 10, 'transaction_percentage' => 0, 'user_name' => 'admin', 'user_id' => 1, 'gross' => 'yes', 'transaction' => 'no' ) ); $search = ['gross' => 'yes']; foreach ($results as $k => $v) { echo "key $k<br>" . PHP_EOL; if ($v['gross'] == $search['gross'] ) { $location_fees = $v['location_fees']; echo "The location fees: ". $location_fees ." % <br><br>" . PHP_EOL; $gross_percentage = $v['gross_percentage']; echo "The gross_percentage is: ".$gross_percentage ."% <br><br>" . PHP_EOL; } else { $tran_perc = $v['transaction_percentage']; echo "The locations percentage is: ".$tran_perc ." % <br>" . PHP_EOL; $the_loc = $v['location']; echo "The location is: ".$the_loc ." <br>" . PHP_EOL; $location_fees = $v['location_fees']; echo "The location fees: ". $location_fees ." % <br><br>" . PHP_EOL; } }
Output for git.master, git.master_jit, rfc.property-hooks
key 0<br> The location fees: 3 % <br><br> The gross_percentage is: 25% <br><br> key 1<br> The locations percentage is: 24 % <br> The location is: 5 <br> The location fees: 5 % <br><br> key 2<br> The location fees: 5 % <br><br> The gross_percentage is: 10% <br><br>

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:
28.05 ms | 406 KiB | 5 Q