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
2
votes
1 answer

How to remove style attribute only with DOMXPATH?

I use DOMXPATH to remove all attributes from the p tag and it works fine, // Loop all p. foreach( $dom->getElementsByTagName( "p" ) as $p ) { // Loop all attributes in p. foreach( $p->attributes as $attrib ) { // Remove all…
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
2 answers

PHP preg_replace replacing numbers along with special chars

I have the following PHP code to remove special characters from a variable; '_', '/&/' => 'and', '/[^[:alpha:]]+/' => '_'); $name2 = preg_replace(array_keys($patterns),…
Alfred
  • 21,058
  • 61
  • 167
  • 249
2
votes
1 answer

What does parameter $tv_sec or $tv_usec as a parameter do?

I've created a simple socket php 5.3 script where the server script calls... socket_select($read_set, $write_set, $exception_set, 2); ...in a loop. I'm using non-blocking sockets and the script is running on a Win7 machine. The problem: This…
Mike
  • 1,992
  • 4
  • 31
  • 42
2
votes
1 answer

PHP ini_set max_execution_time and memory_limit not working

I have the following code inside a file (I'm running it directly via Terminal or I access the webpage, it makes no difference). error_reporting(E_ALL ^ E_NOTICE); ini_set('display_errors', true); ini_set('max_execution_time',…
Sorin Buturugeanu
  • 1,782
  • 4
  • 19
  • 32
2
votes
1 answer

Get interval from DatePeriod variable

As I understood from PHP manual page for DatePeriod class that it is purposed to store periods of time. I.e. interval with some point at time meaning start of the interval + optional recurrences. With the following code I create $dp variable…
Boffin
  • 570
  • 2
  • 7
  • 21
2
votes
3 answers

pimcore debugging

Currently I'm using PIMCore for building my website. I've installed it properly on my server with php 5.3.3. I've made all the different pages and everything worked fine till now. I only get white screens when loading the website. The admin-panel…
Jacob Francke
  • 425
  • 6
  • 23
2
votes
2 answers

Month name to month number - 03 for Feb?

I am trying to convert string month name to month number, but why do I get '03' in the result for 'Feb' in, strtolower(date('m', strtotime('Feb'))); I tested with other month names and they seem to be fine, strtolower(date('m', strtotime('Jan')));…
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
1 answer

"Cannot redeclare class" error when running PHPUnit with Code Coverage

PHPUnit seems to execute properly (appropriate tests are executed & pass), but during code coverage an error is thrown. We are using PHPUnit 3.5 with ZF 1.11. Any insight would be greatly appreciated! (FYI: I looked at some related StackOverflow…
webjawns.com
  • 2,300
  • 2
  • 14
  • 34
2
votes
1 answer

Gettext not working, no error messages, using php 5.3

I've been bouncing my head in this for a couple of days now without any success. I just want to get gettext to work. What happens is that the string as it is written in the php-file is printed, not the translated one. I.e. if i do "echo…
Nicsoft
  • 3,644
  • 9
  • 41
  • 70
2
votes
2 answers

PHP5.3 preg_match with Umlaute UTF-8-modifier

the following command returns true on a PHP5.3.8 Lamp(Ubuntu 11.04)-Server, but false on a PHP5.3.2 Lamp(Ubuntu 10.04.2 LTS)-Server. I nearly changed all settings in the php.ini-file, but without success. I…
2
votes
1 answer

How do I properly typecast PHP variables with SimpleXMLElement?

I'm pulling data from an XML feed and manipulating it using the awesome SimpleXMLElement. However, when I pull a node that is strictly numbers, I can't echo that node's values. After investigating, a comment here…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
2
votes
3 answers

How do I pass a function as a parameter to another function?

I have a list of functions a(), b(), c() I have a main() function. Depending on case, I need to pass a different function to main() to use. In javascript it would be: var a = function(){} var b = function(){} var c = function(){} var func = (some…
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
2
votes
2 answers

PHP 5.3: How on Earth is this Variable Undefined?

I was toying around with some PHP today, doing what I normally do when I try a language I either don't know or am rusty in: write a small crappy card game. The first task was to roll out a sorted deck with all the available cards. Here was my…
Louis
  • 2,442
  • 1
  • 18
  • 15
2
votes
3 answers

Get the width and height of each element's attribute via DOM or XPATH

How can I get the width and height of each element's attribute? For instance, $dom = new DOMDocument; $dom->loadHTML('
'); foreach(…
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
2 answers

How to skip the item in an rss feed if the `description`node does not exist?

How do I skip the item in an rss feed if the description text does not exist? I tried with this line below but I still get an error, if($x -> item($i) -> getElementsByTagName('description')) { then proceed } when I the item in the rss feed appears…
Run
  • 54,938
  • 169
  • 450
  • 748