Please explain why the PHP compiler can handle PHP-defined types but user-defined (in your definition) types need to be treated differently. I keep track of the PHP change log, I scan for things that are likely to impact my code. Thanks all... Home People Match Join Stories Channels TRENDING CHANNELS Stories Celebrity Snapchat Snapchat Entertainment Movies Instagram Funny Sports Videos Technology Pics Music Ask Phhhoto CyberSecurity Beautiful Women WTF NFL Snapcode Womens Fashion http://stackoverflow.com/questions/23267621/yii-recoverable-error-object-of-class-could-not-be-converted-to-string
asked 2 years ago viewed 1635 times active 2 years ago Related 1what is the purpose of a component (class) in Yii0yii memcache include error1Using $this when not in object context It's as if PHP is desperately trying to not be a loosely typed language any more. Not the answer you're looking for? kofkof01 4.5k edited May '14 May '14 Thank you for spotting that, quasipickle.
Home Beginners Storing related records: Object of class Artists could not be converted to string kofkof01 May '14 Created May '14 Last ReplyJul '14 Replies 6 Views1669 Votes 0 kofkof01 4.5k Don't confuse 'type' and 'class'. 'Blah' is a class, 'object' is a built-in type. 'echo some_resource' doesn't make more sense than 'echo some_object', however it remains legal. >>>And as for every I said in general. could you post it?
There's a large amount of automation applied to PHP objects. You do not have to check what the type of a variable is every time you would like to use it in a string capacity. Again - EXACTLY which version of the doc are you using? http://www.yiiframework.com/forum/index.php/topic/3489-php-error-object-of-class-group-could-not-be-converted-to-int-when-i-try-to-use-chtml/ Unsold Atari videogames dumped in a desert?
It is the programmer's responsibility to make sure the parameters are clean before being passed to it. Other languages have features PHP doesn't have, and PHP has features they don't have. How to find punctures in inner tubes? An application programmer is the onewho decides which syntax is appropriate for her particular task.
What is the truth about 1.5V "lithium" cells Parents disagree on type of music for toddler's listening Validate Random Die Tippers Were defendants at the Nuremberg trial allowed to deny the http://www.dizkover.com/Yii/1167/object-of-class-stdclass-could-not-be-converted-to-string-error Reference Sheets Code Snippets C Snippets C++ Snippets Java Snippets Visual Basic Snippets C# Snippets VB.NET Snippets ASP.NET Snippets PHP Snippets Python Snippets Ruby Snippets ColdFusion Snippets SQL Snippets Assembly Snippets Exactly, you'd get a runtime warning that the method you are using is deprecated. In fact - this is a common operation in PHP.
Thecode should have checked the types of the arguments before using themin a string context. http://gsbook.org/object-of/object-of-class-could-not-be-converted-to-string-symfony2.php It delays the problem so that appropriate action can be taken without breaking backward compatibility, that's the point of deprecation. Your fatal error looks perfectly fine to me. And since new code also uses those deprecated features, the longer the deprecation period the worse the problem gets.
ren 4.8k Acceptedanswer edited May '14 May '14 You should give your relationship an alias. Why bother to maintain something which has no use? >> >>Are you saying other languages' designers care less about theirprogrammers? The jobof the language designer is to provide clean and consistent mechanismfor generating any possible expression, including "useless" ones. http://gsbook.org/object-of/object-of-class-could-not-be-converted-to-string-doctrine.php You do not have to check what the type of a variable is every time you would like to use it in a string capacity.
And as for every other comparable programming language - no they don't. And as I said - it increases the problem because new code IS still being written to the deprecated functions. Jun 27 '07 #18 P: n/a Jerry Stuckle email@example.com wrote: On 27 Jun, 14:32, Jerry Stuckle
Now, it's broken and there's no way to make it workagain.
I understand that $album->artist is expecting an id, but if I read the documentation correctly, this integer should automagically be extracted from the $artist object when $album gets saved. And I see no reason to infer that this would cause a cast to the default Object class. > >Good programmers wouldn't leave something like this to thecompiler/interpreter; they'd define it Comparing programming languages and technologies is always productive, there's always something to learn from each other. Word that mean "to fill the air with a bad smell"?
Now, it's broken and there's no way to make it work again. -- gosha bine extended php parser ~ http://code.google.com/p/pihipi blok ~ http://www.tagarga.com/blok Jun 12 '07 #7 P: n/a Schraalhans Keukenmeester Four Birds + One How to send the ESC signal to vim when my esc key doesn't work? It just encourages more sloppy programming. http://gsbook.org/object-of/object-of-class-users-could-not-be-converted-to-string.php No one language isgood for everything.
As of PHP 5, __toString() method is used if applicable. You don't let a taxi driver decide where you're going to go, do you? The error in this function is that it assumes the arguments are clean before being passed to it. It isnot the responsibility of language designers to remove constructs thatmay seem "useless" to them.