Kwebble : Blog

Archief van 21 augustus 2008

  • Don’t forget __isset() with overloaded setters and getters

    Gepubliceerd op 21 augustus 2008 in Programming.

    This post is mostly a marker for me to find the solution for this problem in the future. What problem? Well, a call using empty() to test a class field always returned true even if the field wasn’t empty.

    The reason for this behavior is that the class overloads __set() and __get() to do some extra checking on the fields. But overloading these functions also effects empty(). To make empty() behave normally __isset() must also be overloaded to test the used fields.

    And when implementing __isset() think about __unset(), maybe you need to overload it as well.

    The PHP Manual contains an example of overloading these magic members.

    • oop
    • php
  • De familie Waterhoen

    Gepubliceerd op 21 augustus 2008 in Foto's. 3 reacties

    Tegen het overhangende gras aan de rand van het water zorgt een waterhoen voor een groepje van 4 jongen terwijl hoger op de oever een vijfde jong rondloopt. In de Apenheul kom je niet alleen apen tegen, in een afscheidingsgracht zwom deze familie van waterhoentjes.

    Update: ik heb de titel Meerkoetenfamilie veranderd omdat dit geen meerkoeten zijn maar waterhoentjes. Weet iemand een ezelsbruggetje om die twee uit elkaar te houden?

    • vogel
  • Rubrieken

    • Artikelen
    • Foto's
    • Links
    • Media
    • Overheid
    • Programming
  • Recente Berichten

    • Tip: use the axis:axis:1.4 Maven artifact if you need Axis 1.4 support
    • Google Closure tools
    • Google en Microsoft indexeren tweets
    • De route van de Stad Amsterdam
    • Analoog of digitaal – maak je keuze
  • Abonneren

    • Atom feed Artikelen
    • Atom feed Reacties
  • Archief

© Rob Schlüter - Contact