Re: Quick Poll: PHP 4 / 5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Leaf wrote:
On Tuesday 13 September 2005 05:52 pm, Ryan A wrote:

[x] I never work with PHP 4 anymore, all my work is with PHP 5


so far I've not found any hosts that do PHP5, however I do all my own hosting anyway. I've switched to use PHP5 because I was interested in doing XSL, and the concept of doing objects intrigues me.

XSL support in 5 is far superior. It's a walk in the park now, where as before it was quite confusing.

I'm currently doing a project where the client doesn't know what she wants... because of this I'm constantly having to redo sections to add what she wants.
So taking this approach for this client has saved me from 10 times more work.

I personally can't wait for PDO. I do lots of projects that all use SQL

thats because you don't use firebird DB ;-)

(SQLite, PostgreSQL and MySQL) Right now I have to recode everything to use the right DB. with my newest project I'm using SQLite with a custom Object to handle the DB Object. It's actually design with PDO in mind. After they get PDO in and working well It'll save me hours of work. From that Website about the 6 dumbest ideas. I guess you could say I'm an "early adopter" I like ideas that'll save me time in the long run, even if I'm the one that has to do tons of testing to make it usable. The long run is what matters to me. If I can spend time learning, testing.. and then later be able to do something in 5 mins that'd take 15 the old way.. I'm up for it. Has to be someone to do the testing to bring projects forward isn't there ? ;)

From the opposite side of the spectrum I have had my share of upgrade issues.
One was from 5.0.4 to 5.0.5

$this->urlArr[0] = array_pop($arr = explode("&",$this->urlArr[0]));

I still have to scratch my head as to why I *need* that "$arr = "
prior to 5.0.5 this was not needed.

prior to 5.0.5 this was allowed but technically its the cause of memory corruption
and has now been madce into a fatal error - the reason is that array_pop() takes
its arg as a reference (to a variable) - if you pass it the return value of a function
then its technically not referencing something that exists because the value (the array
that explode returns) only exists in the scope of the explode function call and that dies
when explode returns .... placing the '$arr =' means you are assigning the return value of
explode() to $arr and passing a reference to the same variable.

$this->urlArr[0] = array_pop(explode("&",$this->urlArr[0]));

Perhaps someone here could tell me what was change to make this happen.. and how does that change make the engine better? It seemed to work perfectly fine before.

'seemed' being the operative word. allowing code without the '$arr =' (from your example)
is/was the source of many strange/subtle & difficult (impossible) to debug
segmentation faults (memory corruption) which quite often sprung up in large/complex
codebases.


I've also had to upgrade a few classes written for PHP4 specifically ones that like to use:
var $variable;

Overall, If you can upgrade to 5 .. do so. the advantages in my cases have been so nice. If you can't upgrade, Don't. Use what works. I personally would urge you to upgrade to 5 if you wanna get in deep with objects. I'm sure that 3 and 4 can do them just fine. but whats the use of learning how to do OOP in something that has been updated? Or worded differently, Why learn old ways when you can benefit from newer ideas/implementations ? It'd be like putting logs under a platform and repositioning the log that came out the back in the front again as a way to move something instead of wagon just because it's always worked before.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux