rstoll Posted December 10, 2012 Share Posted December 10, 2012 Hi, I am currently working on my final project of my undergraduate study and the project is about type safety in PHP. One aspect of the project examines the opinion of the PHP community on this topic. I now need your help. I would be very glad, if you could take 5 – 20 minutes to fill in my online survey: http://www.q-set.co.uk/q-set.php?sCode=PGSKQCJUWZVK I will publish the deliverables of my project under an open source license. Thus you contribute automatically to an open source project if you fill in the form Thanks for your help Robert Stoll Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/ Share on other sites More sharing options...
Maq Posted December 10, 2012 Share Posted December 10, 2012 Interesting project, I just finished the survey. Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398626 Share on other sites More sharing options...
Philip Posted December 11, 2012 Share Posted December 11, 2012 Parameters - which improvement towards type safety should be made?[ ] A type for each parameter has to be defined in all functions/methods [ ] A type for each parameter has to be defined in public and protected functions/methods [ ] A type for each parameter has to be defined in public functions/methods [ ] None of the above mentioned [ ] I do not know Why does this one not have an "optional" answer, but the others on the same page do? Object Initialiser as in C# $person = new Person(){Firstname='Robert',Lastname='Stoll'}; //Instead of $person = new Person(); $person->setFirstname('Robert'); $person->setLastname('Stoll'); Forgive my ignorance, but isn't that what a constructor is for? Anyways, I agree with Maq. Interesting project, will be cool to see the results. Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398630 Share on other sites More sharing options...
KevinM1 Posted December 11, 2012 Share Posted December 11, 2012 Why does this one not have an "optional" answer, but the others on the same page do? Object Initialiser as in C# $person = new Person(){Firstname='Robert',Lastname='Stoll'}; //Instead of $person = new Person(); $person->setFirstname('Robert'); $person->setLastname('Stoll'); Forgive my ignorance, but isn't that what a constructor is for? Object initializers are used to populate anonymous types. Anonymous types are types that don't have an actual class definition (thus no parameterized constructor). Instead, they're generated on the fly, usually as the result of some LINQ query. Example: var productInfo = from p in products select new { p.ProductName, p.UnitPrice }; productInfo contains a collection of objects of an anonymous type that are made up of the product's name and price. That info can then be iterated over by a foreach: foreach (var prod in productInfo) { Console.WriteLine("Name: {0} , price: {1}", prod.ProductName, prod.UnitPrice); } Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398749 Share on other sites More sharing options...
Adam Posted December 11, 2012 Share Posted December 11, 2012 Also.. (3) Parameters - which improvement towards type safety should be made? A type for each parameter has to be defined in all functions/methods A type for each parameter has to be defined in public and protected functions/methods A type for each parameter has to be defined in public functions/methods None of the above mentioned I do not know Shouldn't there be an option to optionally define a type for each parameter, like in #4? Forcing a type is going to break about 99% of PHP scripts out there. Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398751 Share on other sites More sharing options...
Adam Posted December 11, 2012 Share Posted December 11, 2012 Okay, think you should have introduced your project a little earlier The comments I wrote at #8 were answered on the next page. Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398754 Share on other sites More sharing options...
.josh Posted December 12, 2012 Share Posted December 12, 2012 maybe it's just me, but that site runs super slow... Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398929 Share on other sites More sharing options...
KevinM1 Posted December 12, 2012 Share Posted December 12, 2012 maybe it's just me, but that site runs super slow... It was slow for me yesterday, too. Page loading took longer than the actual survey. Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1398972 Share on other sites More sharing options...
.josh Posted December 12, 2012 Share Posted December 12, 2012 yeah sorry OP but a few questions in I decided to call it quits..I wasn't really diggin' waiting 10-20s per page load. Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1399017 Share on other sites More sharing options...
rstoll Posted November 29, 2013 Author Share Posted November 29, 2013 Heya, Quite a long time ago (almost a year), I asked you guys to fill in a survey about type safety in PHP which I conducted in context of my bachelor thesis. Unfortunately, I did not really have time to publish all results on a website so far but I am happy to announce that you can find the results here now: http://tsphp.tutteli.ch/wiki/display/TSPHP/Results+online+survey+Type+Safety+in+PHP My bachelor thesis serves as a basis of the open source project TSPHP. You can find further information about it on the wiki as well: http://tsphp.tutteli.ch/wiki/display/TSPHP/Overview Please don't hesitate if you have further questions about the survey or the project. Cheers, Robert Quote Link to comment https://forums.phpfreaks.com/topic/271840-type-safety-in-php/#findComment-1460631 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.