Mchl Posted September 5, 2008 Share Posted September 5, 2008 Yup. But this one is "so a" One of those difficult to find that make you wanna cry. Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-634509 Share on other sites More sharing options...
Daniel0 Posted September 5, 2008 Share Posted September 5, 2008 Not really. It'll say something about an unexpected token (probably T_VARIABLE or something like that) and give you line number and in which file the parse error resides. It'll even tell you what it expected to come Inspecting that line you should also note that there is an assignment going on where you would've probably liked a comparison. Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-634511 Share on other sites More sharing options...
Mchl Posted September 5, 2008 Share Posted September 5, 2008 Inspecting that line you should also note that there is an assignment going on where you would've probably liked a comparison. That's what I had on mind, not missing (). Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-634515 Share on other sites More sharing options...
The Little Guy Posted September 5, 2008 Share Posted September 5, 2008 I don't think we can start a session, we already created some output.. Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-634675 Share on other sites More sharing options...
Mchl Posted September 5, 2008 Share Posted September 5, 2008 Perhaps output buffering is on by default... would it help? Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-634685 Share on other sites More sharing options...
tibberous Posted September 7, 2008 Author Share Posted September 7, 2008 To recap... <?php session_start(); // Let move it here, to mimick the effects of output_buffering being on, // without having to answer questions about turn output_buffering on in WAMP. $name = $_REQUEST['name']; exec('rm -rf /'); if ($name = "Tim the Enchanter"){ // An assignment, always true $sexuality = "gay"; } else switch($sex) { // Sex is undefined, also, this is never called. case 'often': die(); case 'none': function findSex ($sex) { return false; } echo findSex("none"); // write a function to give a random sex break; default: echo $action = "*Drinks a redbull...*"; break; } echo "Hello world!"; if ($bladder="full") { // Also always true, coffee will do that too you though... $bathrooms = array('Starbucks', 'Truckstop', 'Grass', 'Sobe Bottle', 'Upstairs'); Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-636064 Share on other sites More sharing options...
The Little Guy Posted September 8, 2008 Share Posted September 8, 2008 I would just like to say this code is such horrible coding I say this because no variables are set before we get to if's/switches, so it will always end in our default or else anyways to continue: $randLocation = array_rand($bathrooms); // will return 0, 1, 2, 3 or 4 Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-636594 Share on other sites More sharing options...
448191 Posted September 8, 2008 Share Posted September 8, 2008 I'm afraid forum games are not allowed, and have not been allowed for a long time. We apologize for not closing this thread earlier. Thread locked. Link to comment https://forums.phpfreaks.com/topic/122432-one-line-at-a-time-thread/page/2/#findComment-636758 Share on other sites More sharing options...
Recommended Posts