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
3 answers

What's wrong with imagecreatefromstring function?

What is wrong with this code?
ptCoder
  • 2,229
  • 3
  • 24
  • 38
4
votes
1 answer

Fastest possible way to download many images in PHP 5.3?

Im working on script that integrates online shops. I have code like this (simplified): // $asImageurls - array of string with image url's foreach($asImageurls as $sImageUrl) { $imageContent = @file_get_contents($image); // create filename, save…
Kamil
  • 13,363
  • 24
  • 88
  • 183
4
votes
1 answer

Why $pear->packageExists() returns always false on installed package?

I installed Mail (http://pear.php.net/package/Mail) by pear install Mail everything seems to be ok, but checking for this package programmatically: $pear = new PEAR_Registry(); $enabled = $pear->packageExists('Mail'); always fails for me…
Codium
  • 3,200
  • 6
  • 34
  • 60
4
votes
5 answers

Laravel 4 Form builder Custom Fields Macro

Im trying to create a custom HTML 5 date field for using in a laravel 4 framework view. {{ Form::macro('datetime', function($field_name) { return ''; }); }} {{ Form::label('event_start', 'Event Date', array('class' =>…
AndrewMcLagan
  • 13,459
  • 23
  • 91
  • 158
4
votes
4 answers

How do I validate that an uploaded file is a video?

I have a server that has some very sensitive information on it, so security is a big issue. The user needs to be able to upload a video. I know allowing users to upload files poses a security threat because there is no 100% way to keep them from…
Tyler Crompton
  • 12,284
  • 14
  • 65
  • 94
4
votes
1 answer

What's the purpose of ReflectionFunctionAbstract::getClosureThis()?

Along with the introduction of Closures in PHP 5.3, has been introduced a getClosureThis() method on ReflectionFunctionAbstract. Anyone has an idea what it is for? The doc does not say anything about it, Google has been useless so far, and my…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
4
votes
2 answers

mssql_connect no longer working as of PHP 5.3

I just received an email from our host and they've upgraded our PHP to 5.3, unfortunately though, all the scripts have now broken. I traced it down to the function mssql_connect failing. Support told me this has now been deprecated under 5.3 - how…
JCraine
  • 1,159
  • 2
  • 20
  • 38
4
votes
1 answer

Errors were encountered while processing: libapache2-mod-php5 php5 php5-cli

I am using Ubuntu 11.10 now. When I struggled to install php5 by typing sudo apt-get install php5 I got this error: ...... Errors were encountered while processing: libapache2-mod-php5 php5 php5-cli E: Sub-process /usr/bin/dpkg returned an…
user1397595
  • 147
  • 1
  • 5
  • 14
4
votes
1 answer
4
votes
1 answer

php 5.3 convert array_walk_recursive

I have the following code, and I'd like to get away from the call-time pass-by-reference, (To convert from 5.2 to 5.3) but I'm not sure exactly sure what the correct way to do this would be (class, global variable, ?) Here is a codepad that should…
merlincam
  • 1,818
  • 3
  • 16
  • 16
4
votes
4 answers

Should I upgrade to PHP 5.3?

PHP version 5.3 has been released, and although it looks great, all my code already works fine. I don't see what this new version offers to justify upgrading and working through possible issues after the upgrade. Should I upgrade anyway just for…
user47322
4
votes
6 answers

Converting json to array with recursive method?

I am trying to convert json string inside an array into array, $config = array( "type" => '{"category":"admin","page":"page"}', "say" => "Hello", "php" => array( "say" => "no", "type" =>…
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
3 answers

How to return null inside the function/method if a property in the class is not found?

I use stdClass to convert an array to an object, function array_to_object($array) { if(!is_array($array)) { return $array; } $object = new stdClass(); foreach($array as $key => $value) { $key = (string) $key ; …
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
1 answer

Lithium form helper data and errors missing?

I am building a test Lithium app to learn how it works and I found that the form helper doesn't seem to recognise my data being passed back or any validation errors. At the moment I'm having to manually pass back my errors and then process them in…
David Yell
  • 11,756
  • 13
  • 61
  • 100
4
votes
2 answers

MySQL: remove number prefix from all records

I have this page table below and I want to remove the numbering prefix of '999' from the column of template_id, page_id template_id url 1 9991 a 2 9992 b 3 9993 c 4 4 …
Run
  • 54,938
  • 169
  • 450
  • 748