By Harry Fuecks

Backwards Compatibility in PHP5

By Harry Fuecks

…is, simply put, excellent.

Been checking out WACT under PHP 5.0.0. So far have run into only one critical (but easy to fix) issue with parse_ini_file now returning an empty array, instead of FALSE, when it fails to find the ini file. There’s some other minor issues which I’ve yet to look at but no show stoppers.

WACT, IMO, pushes PHP pretty hard, particularily with OO is concerned. As we have pretty good unit test coverage, thanks to Simple Test, bugs tend to show up quickly. So far it’s looking like WACT will “work” all the way from PHP 4.0.6 (I’ve personally tried 4.1.0 and Sourceforge runs 4.1.2) up to PHP 5.0.0. To me that’s pretty impressive and testament to the outstanding job they’ve done on 5.0.0.

That’s not to say PHP 5.0.0 is 100% stable yet. John points out problems with HTTP basic authentication here, for example. If the past is anything to go by, PHP 4.x really became stable with 4.0.6.

  • Luke

    Watch out for get_class(). It now returns your class name case sensitive so just to be sure you have the old functionality (if you need it) do a strtolower($class_name) == strtolower(get_class($object)).

  • Good point. The same applies to other reflection functions like get_class_methods() (this was one of those minor issues in WACT).

    PHP5 has been changed so that reflection methods and similar return the class / method name in it’s original case, rather than converting to lower case (even though calls to functions / methods / classes are still case insensitive).

    My understanding of why they did this was for working with external systems (e.g. SOAP + WSDL) where you need preserve the case on things like remote procedure names to call them.

  • Hi…

    I actually had some problems with mock objects in SimpleTest and also comparisons. Hardly surprising since references have changed syntax, but the change in meaning of “===” would change assertIdentical() into assertReference() without fixes. I am not 100% sure there aren’t bugs lurking here. Any issues from the WACT team?

    yours, Marcus

  • Interesting. Searching the tests the only time I found us using assertIdentical to compare objects what here in the testImportDataSetAsArray() test. There may actually be subtle bugs there as “importing” a dataset in a “DataSourece” should clone the original object, not reference it. By chance, the way this test is set up it still passes, given what you describe with assertIdentical.

  • Wact Addict


    Is the bug fixed in wact cvs?

Get the latest in Front-end, once a week, for free.