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'; $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
20140808 Warning: Undefined variable $rec in /in/KqAHX on line 26 Warning: Undefined variable $data in /in/KqAHX on line 53 Warning: Trying to access array offset on value of type null in /in/KqAHX on line 53 Warning: Undefined variable $data in /in/KqAHX on line 54 Warning: Trying to access array offset on value of type null in /in/KqAHX on line 54 Array ( [charity_id] => [account_id] => [action] => Unselected Charity : charity )
Output for rfc.property-hooks
20140808 Warning: Undefined variable $rec in /in/KqAHX on line 26 Warning: Undefined variable $data in /in/KqAHX on line 53 Warning: Trying to access array offset on null in /in/KqAHX on line 53 Warning: Undefined variable $data in /in/KqAHX on line 54 Warning: Trying to access array offset on null in /in/KqAHX on line 54 Array ( [charity_id] => [account_id] => [action] => Unselected Charity : charity )

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:
37.13 ms | 401 KiB | 8 Q