Totally perplexed..

    Date: 02/07/07 (PHP Community)    Keywords: php

    Has anyone else ever had this happen when calling an object dynamically (meaning you get $var as a string then do new $var()

    The parent completely and totally ignores calls from the child?!?!?!

    Child snippet:

    function getProductList($attributes) {
    		//var_dump(get_parent_class($this));exit;
    		return parent::getProductList($attributes);
    	}


    Parent snippet:
    function getProductList($attributes = false) {
    		echo "break here";exit;
    		global $dbs;
    
    		//var_dump($...


    I can get anything I want from the child function, nothing from the parent. The commented line above giving me the parent class shows the correct value. I mean, if the parent wasn't loaded, I'd get an error right? It extends the parent class, etc. So why can I not get anything from the parent object????

    I've never had this happen and am totally perplexed. Or going insane. Perhaps I broke PHP's already weak OO structure??? Anyone ever had this happen before?


    I'm an ultra goober. Had an extra bracket at the end of a function (and missing one later) that basically ended the class before that method. Duh.

    Source: http://community.livejournal.com/php/539430.html

« Faster tableExists function || mySQL, BLOBs and image streams »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home