3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $pay_date = '20140808'; $cutoff_date = '20140728'; $next_bill_date = '20140808'; $recurrence = '3'; $rec = '3'; $today = date_create(); $cutoff_date = date_create_from_format('Ymd',$cutoff_date); $next_bill_date = date_create_from_format('Ymd',$next_bill_date); $pay_date = $next_bill_date; $outputstring = $pay_date->format('Ymd'); echo $outputstring; $days = ((int)date_format($pay_date, 'j'))-1; if ( $days > 0 ) { date_modify($pay_date, "-$days day"); } if($rec > 0){ $history = array ( 'account_id' => 'account', 'pay_amount' => '20.00', 'charity_id' => 'charity' ); if ($today > $cutoff_date) { date_modify($pay_date, '+1 month'); } for( $i = 1; $i <= $rec; ++$i ) { $history['pay_month'] = date_format($pay_date,'n'); $history['pay_year'] = date_format($pay_date,'Y'); print_r($history); if ( $i == $rec ) break; date_modify($pay_date, '+1 month'); } } else { $newData = array( 'charity_id' => $data['charity_id'], 'account_id' => $data['account'], 'action' => 'Unselected Charity : charity' ); print_r($newData); }
Output for git.master, git.master_jit, rfc.property-hooks
20140808Array ( [account_id] => account [pay_amount] => 20.00 [charity_id] => charity [pay_month] => 8 [pay_year] => 2014 ) Array ( [account_id] => account [pay_amount] => 20.00 [charity_id] => charity [pay_month] => 9 [pay_year] => 2014 ) Array ( [account_id] => account [pay_amount] => 20.00 [charity_id] => charity [pay_month] => 10 [pay_year] => 2014 )

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:
35.22 ms | 402 KiB | 8 Q