php5.3

Update to php5.3 breaks connecting to mysql db

I just updated php to 5.3 and can no longer connect to my remote mysql server. I get the following errors: mysqli_connect(): OK packet 6 bytes shorter than expected mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using old authentication It seems this has to do with the new mysqlnd driver. Is there a way to force ...

WTF. Strong data typing bug in PHP 5.3?

Hi Is it normal to get the error "Default value for parameters with a class type hint can only be NULL" for a method in an interface defined as public function nullify(bool $force=FALSE); ? I need it to be bool, not an object, and FALSE by default. ...

Upgrade PHP from version 5.2 to 5.3

Hello, I've been using PHP version 5.2 and now need to upgrade to version 5.3 (Windows/Apache). I have been using 5.2 for awhile now and have customized many things in php.ini and added some extra extensions. How can I upgrade to version 5.3 without having to reconfigure everything? Or does upgrading require that I customize my PHP i...

PHP 5.3.0 - Is it stable enough for production use?

I'm running a couple of sites and are thinking about moving over to using Nginx instead of Apache and as such I need to move to FCGI where the preferred choice right now seem to be PHP-FPM. I'm simply wondering about what version of PHP to use. My current sites (using Apache and mod_php i.e. plain vanilla LAMP installation) is using 5.2...

How did PHP 5.3 break your application?

PHP 5.3 has been released some time ago and the developers tried to keep the number of backwards compatibility breaks low. What issues did you find while testing/migrating your code with PHP 5.3? ...

How can I send all php errors run on one page to an email?

Basically I have a single page on my site that I want any php erorrs, warnings, etc to be sent to me in an email every time the script is run. Edit: this must be code that is placed on the page, not an edit to php_ini or anything like that. Edit 2: this needs to catch ALL errors and send ALL errors in one email at the end of the script...

Is it possible to overuse late static binding in PHP?

Starting with version 5.3, PHP supports late binding for static methods. While it's an undoubtedly useful feature, there are only several cases where its use is really necessary (e.g. the Active Record pattern). Consider these examples: 1. Convenience constructors (::create()) class SimpleObject { public function __construct() {...

Is there a well-established naming convention for PHP namespaces?

So far, I've seen many different naming conventions used for PHP namespaces. Some people use PascalCase\Just\Like\For\Classes, some use underscored\lower_case\names, some even use the Java convention for package names: com\domain\project\package. The question is very simple -- can any of these (or other) conventions be called well-establ...

How do I use PHP namespaces with autoload?

I get this error when I try to use autoload and namespaces: Fatal error: Class 'Class1' not found in /usr/local/www/apache22/data/public/php5.3/test.php on line 10 Can anyone tell me what I am doing wrong? Here is my code: [root@data /usr/local/www/data/public/php5.3]# ls -l total 8 -rw-r--r-- 1 root wheel 160 Dec 1 23:46 Class1....

Can I change the compression level of ZipArchive?

Is it possible to change the compression level and/or method used by the ZipArchive class? ...

Strategy for developing namespaced and non-namespaced versions of same PHP code

I'm maintaining library written for PHP 5.2 and I'd like to create PHP 5.3-namespaced version of it. However, I'd also keep non-namespaced version up to date until PHP 5.3 becomes so old, that even Debian stable ships it ;) I've got rather clean code, about 80 classes following Project_Directory_Filename naming scheme (I'd change them t...

Any PHP MVC framework planning to use 5.3 features?

I would like to get started with PHP, and 5.3 release seems to bring many nice features (namespaces, lambda functions, and many others). I have found some MVC frameworks, and some of them support only PHP 5: PHP Frameworks PHP MVC Frameworks Model–view–controller on Wikipedia but can anyone recommend one of those MVC frameworks that...

Is PHPs SoapServer affected by the maximum execution time?

I recently created a Java frontend for a PHP web-service which uses PHPs SoapServer. My application is performing a long-running data synchronization and from what I know from PHP I prepared myself to get closed connections because of the max_execution_time limit. But I never get any kind of error, as if the SoapServer instance is runn...

variable predefinition, moving variable to earlier point

Ok, here's the deal where I'm really stuck. I use my cms with design patterns. Where's the last final output(in design template's main file: 'design.php'): <div>{CONTENT_HEADER}</div> <div style='float:left;width:25%'>{CONTENT_LEFT}</div> <div style='float:left;width:50%'>{CONTENT_CENTER}</div> <div style='float:left;width:25%'>{CONTEN...

Transfer a variable to earier point without goto

How to write this without goto: ob_start(); $a = 0; echo "START of LEFT<br />"; begin: if($a > 0) { echo "CONTENT LEFT: $a<BR />"; <VERY DIFFICULT ALGORHITM> goto end; } <... ALL THE REST CODE OF LEFT ...> echo "END of LEFT<br /><br />"; $output1 = ob_get_contents(); ob_end_clean(); ob_start(); echo "START ...

Pass by reference problem with PHP 5.3.1

Ok, this is a weird problem, so please bear with me as I explain. We upgraded our dev servers from PHP 5.2.5 to 5.3.1. Loading up our code after the switch, we start getting errors like: Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in /home/spot/trunk/system/core/Database.class.php on line ...

php_ssh2.dll for PHP 5.3.1 on WinXP Pro sp3

I had PHP 5.2.2 installed on a previous box (also WinXP Pro sp3) and had gotten the SSH2 extension from http://pecl4win.php.net/ext.php/php_ssh2.dll. Sadly that server seems to be out of commission for now ("The pecl4win build box is temporarily out of service. We're preparing a new build system."). The old DLL doesn't work with the ne...

PHP extension: convert an object to string with __toString()

Writing a PHP extension in C, I want to convert a userland object (IS_OBJECT) to a string through __toString() if it has one, and fail otherwise. What should I use? I don't need another zval on output, just a char *. zval *zo; switch (Z_TYPE_P(zo)) { case IS_STRING: ... Z_STRVAL_P(zo) ... break; case IS_OBJECT: ... ???(zo)...

PHP 5.3 How to autoload constants?

Hey all. I was hoping that if I were to define constants in a separate namespace, like: <?php namespace config\database\mysql; const HOST = 'localhost'; const USER = 'testusr'; const PASSWORD = 'testpwd'; const NAME = 'testdb'; ?> That I would be able to use __autoload to automatically include them: <?php function __autoload($clas...

PHP 5.3 Documentor?

Hello, I was wondering if there is a documentation solution available that supports PHP 5.3. We are having two problems with phpDocumentor. First, it lacks 5.3 support. Second, it requires too much memory when used on our codebase. Could anyone suggest viable alternatives to phpDocumentor? Thank you! ...