Fatal Error Cannot Use For Reading In C
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of fatal error cannot use object of type this site About Us Learn more about Stack Overflow the company Business Learn fatal error cannot use object of type stdclass more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question fatal error cannot use object of type wp_error x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up php fatal error cannot use object of type Fatal error: Cannot use [] for reading in [closed] up vote -4 down vote favorite I'm getting an error (posted below) when executing my PHP code: Fatal error: Cannot use [] for reading in query result in array Array ( [] => Array ( [content] => Quodsi animae tuae infami cum magna......... [format] => html ) ) This is the PHP Code: $result[]['conent']
Fatal Error Cannot Use Isset On The Result Of An Expression
This data I am using within the loop itself. So how to get value for both content and format. php share|improve this question edited Sep 12 at 6:29 Magisch 4,80162148 asked Jan 3 '14 at 13:23 Code Lover 1,85593881 closed as off-topic by Glavić, Rikesh, OGHaza, Sverri M. Olsen, tereško Jan 3 '14 at 23:57 This question appears to be off-topic. The users who voted to close gave this specific reason:"Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist" – Glavić, Rikesh, OGHaza, Sverri M. Olsen, tereškoIf this question can be reworded to fit the rules in the help center, please edit the question. 2 If you would var dump the $result like var_dump($result);, you would probably see that key is empty string: $result['']['conent'];. –Glavić Jan 3 '14 at 13:25 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted $arrayVar[] is effectively the same (give or take) as array_push($arrayVar, 'Add this'); So it implies that you're assigning a new
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site
Fatal Fontspec Error Cannot Use Pdftex
About Us Learn more about Stack Overflow the company Business Learn more laravel cannot use [] for reading about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss array_push Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Cannot http://stackoverflow.com/questions/20904699/fatal-error-cannot-use-for-reading-in use [] for reading up vote 0 down vote favorite I'm getting this error Fatal error: Cannot use [] for reading in... on line 26 Checking all the threads that have been made here on this error, I still cannot figure it out. Looking at my code there's nothing I'm doing wrong. http://stackoverflow.com/questions/30839772/fatal-error-cannot-use-for-reading $postnummer; private $poststed; private $telefonnummer; private $fodselsdato; public function __construct($navn, $adresse, $postnummer, $poststed, $telefonnummer, $fodselsdato) { $this->navn = $navn; $this->adresse = $adresse; $this->postnummer = $postnummer; $this->poststed = $poststed; $this->telefonnummer = $telefonnummer; $this->fodselsdato = $fodselsdato; } //Creates an array to store education for a person// private $utdanning = array(); //Function to add education to the array// public function leggTilUtdanning(Utdanning $utdanning) { $this->utdanning[] = $utdanning; } } //Class for education class Utdanning { private $institusjon; private $studieretning; private $grad; private $startet; private $ferdig; public function __construct($institusjon, $studieretning, $grad, $startet, $ferdig) { $this->institusjon = $institusjon; $this->studieretning = $studieretning; $this->grad = $grad; $this->startet = $startet; $this->ferdig = $ferdig; } } $person1 = new Person('Dave Lewis', 'Downing Street 14', 0442, 'Northville', 98765432, '17.05.1975'); $utdanning = new Utdanning('Harvard', 'Economics', 'Bachelor', 2013, 2016); $person1->leggTilUtdanning($utdanning); ?> The error comes from the line inside the function where I'm trying to add an Utdanning-object to the array. It's funny, cause I tried this very same method of doing it on another project, using the exact same syntax, and it worked perfectly. Furthermore, I don't understand why it says I'm trying to read from the array, when I'm actually adding to it. Does anyone
Cannot use [] for reading The SitePoint Forums have moved. You can now find them here. This forum is now closed to new posts, but you can browse existing content. You can find http://www.sitepoint.com/forums/showthread.php?548963-Fatal-error-Cannot-use-for-reading out more information about the move and how to open a new account (if necessary) here. If you get stuck you can get support by emailing forums@sitepoint.com If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you cannot use want to visit from the selection below. SitePoint Sponsor User Tag List Results 1 to 2 of 2 Thread: Fatal error: Cannot use [] for reading Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode May 17, 2008,23:03 #1 Shaun(OfTheDead) View Profile View Forum Posts Keep Moving Forward Join Date Nov 2005 Location Trinidad Posts 3,746 Mentioned 45 Post(s) Tagged error cannot use 0 Thread(s) Fatal error: Cannot use [] for reading Fatal error: Cannot use [] for reading Has anyone ever seen that error message before? Anyone know what causes it ? I'm writing a PHP function and creating an array of the HTML output which I intended to implode at the end and return, but for some odd reason that error message keeps coming up at the implode line. I've double checked my syntax about fifteen times and everything seems right. Here's a simple function to illustrate... Code PHP: function deBugger() { $output_Debugger[] = '
'; $output_Debugger[] = 'Hello World'; $output_Debugger[] = '
'; echo implode("\n",$output_Debugger[]); } Am I missing something obvious? I have no idea why this souldn't be working. Thanks a lot in advance. Trying to fill the unforgiving minute with sixty seconds' worth of distance run. Update on Sitepoint's Migration to Discourse May 17, 2008,23:10 #2 Shaun(OfTheDead) View Profile View Forum Posts Keep Moving Forward Join Date Nov 2005 Location Trinidad Posts 3,746 Mentioned 45 Post(s) Tagged 0 Thread(s) hahaha Okay I figured it out. This... Code PHP: echo implode("\n",$output_Debugger[]); Should be this... Code PHP: echo implode("\n",$output_Debugger); (Without the "[]" at the end of the variable name). Trying to fill the unforgiving minute with sixty seconds' worth of distan