3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $today=date("Y/m/d"); $date = new DateTime::createFromFormat("l dS F Y", $in); $con = mysql_connect("localhost","root"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("royal", $con); {echo $i."<br>"; for ($y=1; $norooms>=$y; $y++) { echo "Day difference=".$len." No of rooms=".$norooms."<br>"; $date = $date->format('d/m/Y'); $sql="INSERT INTO singlerooms (Date,Ref_Date)VALUES ($date,$today)"; mysql_query($sql,$con); } }
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected 'createFromFormat' (T_STRING), expecting variable (T_VARIABLE) or '$' in /in/hocdB on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /in/hocdB on line 4
Process exited with code 255.