3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php protected function setInterval($days, $months) { $years = 0; if ($months > 12) { $years = floor($months / 12); $months = $months % 12; } return "{$years} years, {$months} months, {$days} days"; } echo setInterval(0, 14);
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected 'protected' (T_PROTECTED), expecting end of file in /in/HZFrg on line 2
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in /in/HZFrg on line 2
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_PROTECTED in /in/HZFrg on line 2
Process exited with code 255.