I have the following oddity in our development enviroment. Lets say i have 2 classes one is in namespace \wtf
namespace \wtf\isWrongHere;
class DrStrange {
}
And i have an other class wich i am passing the class via dependency injection
namespace \normalPpl;
class ThisHasNoLogic {
public function __construct(DrStrange $strange){
//here be dragons
}
}
Now when i instanziate the class via:
$whata = new ThisHasNoLogic(new \wtf\isWrongHere\DrStrange());
On My dev debian machine i get normal instance, on our dev machine(a clone of our live server) i get normall results to.
BUT on our live machine i get a fatal error. How is that possible?
PHP Catchable fatal error: Argument 2 passed to xxxx must be an instance of xxxxx, instance of aaaaar given, called in ....QQ
In all servers it is acepting the input type but on live it dous tel me tht the class passed dous not match the required...
aka \wtf\isWrongHere\DrStrange ist not a instance of DrStrange, wich is just plain WTH@12 moment for me.
Here are the specs:
development Machine:
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 14:18:06) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Server version: Apache/2.2.16 (Debian)
Server built: Apr 1 2012 07:14:38
Server's Module Magic Number: 20051115:24
Server loaded: APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
Test machine:
PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 13:11:17)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Server version: Apache/2.2.16 (Debian)
Server built: Mar 3 2013 12:09:44
Live:
PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 13:11:17)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Server version: Apache/2.2.16 (Debian)
Server built: Mar 3 2013 12:09:44
I dont know what to do to make the test server behave like the Live. Anyone any sugesstions??
UPDATE:
When i use the:
use \wtf\isWrongHere\DrStrange;
It works. But i have no way to reproduce it on the test systems which are ignoring this error. i want to replicate it on a diferent machine. Tht is my actual problem which is pleguing my team for over 1 year.