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

laravel resource change the id when get data

i am using the resource in laravel when I get the data its ask me for the id but the primary key in my table is user_menu_id how to change the using resource route route Route::resource('/UserMenuController', 'UserMenuController'); error Unknown…
Sam
  • 151
  • 1
  • 1
  • 9
3
votes
1 answer

PHP 5.3 Function name must be a string

I got an error Function name must be a string on this line, I think it's might be a compatibility problem because this line was written in php 7 public static $renderers = array(); public static function somefunction($tpl, $params) { return…
Abudayah
  • 3,816
  • 7
  • 40
  • 60
3
votes
2 answers

PHP Magic faster than simply setting the class attribute?

Well, not exactly that, but here is an example. Can anyone explain the difference between B and C? How can it be faster to use a magic function to dynamically set a value instead of simply setting the value in the attribute definition? Here is some…
Marc Trudel
  • 1,244
  • 1
  • 12
  • 19
3
votes
2 answers

PHP crypt function on different OS

In my php application I use the php crypt() function where my salt value is the first two characters from the username. I noticed that the function returns a different result on windows and linux. I also read on w3cschools that this function behaves…
Madalina
  • 1,297
  • 6
  • 15
  • 25
3
votes
4 answers

typehinting: method should accept any $arg that is an object

I have a class 'Collection', which has an add method. The add method should only accept objects. So this is the desired behaviour: $x=5;//arbitrary non-object $obj=new Foo; //arbitrary object $collection=new Collection; $collection->add($obj);…
dnagirl
  • 20,196
  • 13
  • 80
  • 123
3
votes
1 answer

Implement finally in PHP 5.5 and below

Is there a way to implement a finally block for PHP versions below 5.5?
cryptonkid
  • 924
  • 1
  • 17
  • 25
3
votes
1 answer

Better way to convert array of objects in PHP to associative array to populate a HTML select

Say I have an array of objects with the following structure: Array ( [0] => stdClass Object ( [category_id] => 5 [category_title] => Meetings [category_slug] => meetings [category_summary] => This is the…
geoffs3310
  • 5,599
  • 11
  • 51
  • 104
3
votes
2 answers

Nginx : UTF-8 charset instead of ISO-8859-1

I want my Nginx output ISO-8859-1 and not UTF-8 : #curl -I www.xyz.com HTTP/1.1 200 OK Server: nginx Date: Fri, 26 Feb 2016 15:36:47 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Vary: Accept-Encoding X-Powered-By:…
wouf
  • 89
  • 1
  • 2
  • 8
3
votes
1 answer

Show Full Stack Trace on PHP Command Line

Problem My PHP Stack Trace is abbreviated: Stack trace: #0 /www/html/table/app/create.php(128): SoapClient->__call('call', Array) #1 /www/html/table/app/create.php(128): SoapClient->call('5e81ad4c12668ec...', 'table.ad...', Array) Expected…
JMC
  • 1,700
  • 7
  • 25
  • 34
3
votes
1 answer

How does PHP interpret and evaluate function and anonymous function when passed as an argument?

I am a experience developer in PHP, I already know what is a function and what is a anonymous function. I also know what is the use of anonymous function and functions in PHP or in other languages. I also know the difference between function and…
Chetan Ameta
  • 7,696
  • 3
  • 29
  • 44
3
votes
2 answers

Overriding fetch() for PDO when fetching using foreach

I have extended PDOStatement and modified the fetch() method to typecast values of the types timestamp and arrays, in PostgreSQL, to DateTime and native array. This works as intended but I can't override the behaviour when using the statement in a…
runfalk
  • 1,996
  • 1
  • 17
  • 20
3
votes
2 answers

PHP Anonymous functions: undefined variable

I'm having these two WordPress functions: $wpb_set_post_views = function($postID) { $count_key = 'wpb_post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; …
marcelo2605
  • 2,734
  • 4
  • 29
  • 55
3
votes
2 answers

How to enter keys into array using defined ranges?

So I have code that outputs the following: $test = array('test1.txt' => '1 June 2015', 'test2.txt' => '1 June 2015', 'test3.txt' => '1 June 2015', 'test4.txt' => '1 June 2015', 'test5.txt'…
Ted
  • 515
  • 1
  • 4
  • 14
3
votes
1 answer

Update session in symfony2 for shoppingg cart

I have the following code : public function addAction(Request $request){ //Get submited data // Get Value from session $sessionVal = $this->get('session')->get('aBasket'); // Append value to retrieved array. $aBasket =…
TanGio
  • 766
  • 2
  • 12
  • 34
3
votes
6 answers

Should I upgrade my server's PHP to version 5.3?

I have php 5.2.11 on my server. Should I upgrade to the new PHP 5.3.2? Any new features which can save my life? Any suggesstions?
John