Questions tagged [php-5.3]

PHP 5.3 (now past End of Life) is the successor to PHP 5.2. It was released on June 30, 2009. Use this tag for version-specific issues relating to specifically to PHP 5.3.

The last version of PHP 5.3 was 5.3.29, which was released on 14-Aug-2014. This version has reached its end of life and will no longer receive any updates.

PHP 5.3 caused many headaches for legacy software as a number of mechanisms PHP had relied on were deprecated (most notably register_globals and safe_mode). Many string search related functions were deprecated too, such as split() and ereg(). Much code written before PHP 5 (and some during) makes use of both these, and therefore a lot of older code base needed updating.

See https://php.net/manual/en/migration53.deprecated.php for a full list.

Information

  • If you want to talk about PHP or if you have a question, you can come to Chat Room 11: PHP.
  • For global question on PHP, please use the generic tag:
1291 questions
4
votes
1 answer

PHP PDO with Special Characters

I am using PDO for MySQL database connection, selecting, updating and deleting. But I have a problem with selecting rows with special characters, for instance, I want to select a page title with 'Judge-Fürstová Mila', Table page, id title …
Run
  • 54,938
  • 169
  • 450
  • 748
3
votes
1 answer

How to get duration in microseconds

I want to measure how long a specified part of my php script takes, e.g. $startTime = microtime(true); //some operations which needs 0.1 to 100 seconds to run $endTime = microtime(true); How can I get the duration in microseconds as an integer?…
Roland
  • 488
  • 1
  • 4
  • 13
3
votes
2 answers

Integer division in PHP produces zero - how to cast it to float?

In a Russian card game I'm trying to keep statistics of how often a player swears (says "bad words" - and we do have a lot of them in Russian language) in the following PostgreSQL table: # select * from pref_chat order by swear desc; id …
Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
3
votes
1 answer

PHP fails to parse large post variable

I'm trying to pass a rather large post request to php, and when I var_dump $_POST array, one, the most large, variable is missing. (Actually that's base64 encoded binary upload as part of a post request) Funny thing, that on my development PC…
Nameless
  • 2,306
  • 4
  • 23
  • 28
3
votes
3 answers

Lithium all rows in cookies, session

Currently after login Lithium stores in session and cookies all rows from users table like password, hash etc. How to remove (don't allow to store) some of the information like password and hash?
Mr. Sensitive
  • 685
  • 1
  • 6
  • 16
3
votes
2 answers

foreach change last element

Possible Duplicate: Strange behavior Of foreach Why PHP sometimes change last element of array? I have a array: Array ( [0] => a_ [1] => b_ [2] => c_ [3] => d_ ) When I try print out all emenets. And output is: a_ b_ c_ c_ Full…
neworld
  • 7,757
  • 3
  • 39
  • 61
3
votes
2 answers

How do I get file info + body with file_get_contents('php://input')?

When I POST with attaching (uploading) a file, I would expect to see the file when I inspect the raw body of the request on the server. I don't. I am using file_get_contents('php://input') to see the raw body of the request. What should I use to…
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
3
votes
3 answers

Exception Thrown In Parent Class Not Caught In Child Class

This error is happening when using the Facebook PHP SDK but I actually think it's a general error. When I run this code, everything works fine and the exception is caught: $facebook = new Facebook('appId'=>APP_ID,'secret'=>APP_SECRET); try { …
derekbeau
  • 91
  • 7
3
votes
2 answers

Static Inheritance prior to PHP 5.3

class A { static $v = "A"; static function echoExtendedStaticVariable() { echo self::$v; } } class B extends A { static $v = "B"; // override A's variable with "B" } Why does: echo B::$v print "A"? And how do I get it…
Alex V
  • 18,176
  • 5
  • 36
  • 35
3
votes
1 answer

Getting Content of PHP file upload error

I am working with the move_uploaded_file() function in PHP. I've managed to successfully troubleshoot a problem I was encountering, but I would like to be able to get the actual content of the warnning or error message. According to php.net…
Bad Programmer
  • 3,642
  • 13
  • 46
  • 53
3
votes
2 answers

PHP Mechanism to Suppress Strict Standards Messages

We are working on a PHP application developed for 5.2, but we recently migrated to PHP 5.3. We haven't had the time to go through and fix all the issues with the migrating to PHP 5.3. Specifically, we have a lot of messages: Declaration of…
Brian Fisher
  • 23,519
  • 15
  • 78
  • 82
3
votes
3 answers

How can I create a URL rewrite similar to Wordpress in my own PHP app

I am working with PHP5.3.6 on Windows 2008R2. In Wordpress, I can set all kinds of friendly URLs which ultimately route to one PHP page. From the outside, it looks like many pages, but is only one. In the web.config file (or .htaccess) file, there…
Ralph M. Rivera
  • 769
  • 3
  • 12
  • 25
3
votes
2 answers

Sensiolabs/Symfony duplicated components: Which ones should I use?

Pimple or Container? http://pimple.sensiolabs.org/ http://components.symfony-project.org/dependency-injection/ Twig or Template? http://twig.sensiolabs.org/ http://components.symfony-project.org/templating/ I'm not asking for an opinion, I just want…
HappyDeveloper
  • 12,480
  • 22
  • 82
  • 117
3
votes
2 answers

How to define a class with same name as built-in function?

I would like to define a class named "List" like this: class List { } PHP gives the following error at the file of the class definition: "Parse error: syntax error, unexpected T_LIST, expecting T_STRING" Apparently there is a php built-in function…
Bazzz
  • 26,427
  • 12
  • 52
  • 69
3
votes
1 answer

Best way to get a files mime typein PHP

What is the best way to get the mime type of a file? Before any answers are given, here are a list of a few things to consider. Can't rely on upload form for accuracy Fileinfo has been inaccurate in 5.3 with testing mime_content_type has been…
Devin Dixon
  • 11,553
  • 24
  • 86
  • 167