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
5
votes
5 answers

Forget late static binding, I need late static __FILE__

I'm looking for the get_called_class() equivalent for __FILE__ ... Maybe something like get_included_file()? I have a set of classes which would like to know what directory they exist in. Something like this:
bobthecow
  • 5,047
  • 25
  • 27
5
votes
3 answers

Why does PHP overwrite values when I iterate through this array twice (by reference, by value)

If I iterate through an array twice, once by reference and then by value, PHP will overwrite the last value in the array if I use the same variable name for each loop. This is best illustrated through an example: $array = range(1,5); foreach($array…
Jeremy Kauffman
  • 10,293
  • 5
  • 42
  • 52
5
votes
1 answer

OCI8 php extension installation on windows server

I have specific problem with making OCI8 work on my server installation. First setup: Win 2008 Server 32bit ZendServer for PHP with Apache2.2 PHP version 5.3.14 which was without php_oci8 files No oracle things installed I need to be able to…
Yoshi
  • 125
  • 1
  • 2
  • 9
5
votes
1 answer

How to connect to MSSQL 2000 from PHP 5.3 and up

I have a legacy business application built on MS SQL Server 2000. I have some webbased utilities that access this database using PHP 5.2 with mssql extension. I need to reinstall the web server, and I looked forward to upgrade to PHP 5.4.…
Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
5
votes
4 answers

getting authenticated user onAuthenticationSuccess

I have the following authentication handler: class LoginAuthSuccessHandler implements AuthenticationSuccessHandlerInterface, AuthenticationFailureHandlerInterface { private $router; private $container; /** * Constructor * @param…
adit
  • 32,574
  • 72
  • 229
  • 373
5
votes
5 answers

php function doesn't return a value

I have a class which works fine with php 5.3 (XAMPP 1.7.3, windows 7) but doesn't work in my server(php 5.2.17 - Safe mode On): connection =…
undone
  • 7,857
  • 4
  • 44
  • 69
5
votes
2 answers

Use other table than user for login authentication

For my project I have used the student table for authentication and storing information. For student registration all the datas are inserted in the student tale fine unlike login authentication. The attributes of the student table are [id(primary…
Banshidhari
  • 478
  • 2
  • 12
5
votes
4 answers

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:…
Citizen
  • 12,430
  • 26
  • 76
  • 117
5
votes
2 answers

using the php 5.4's new constant ENT_DISALLOWED in htmlentities

There is a string I'm trying to output in an htmlencoded way, and the htmlentities() function always returns an empty string. I know exactly why it does so. Well, I am not running PHP 5.4 I got the latest PHP 5.3 flavor installed. The question is…
Average Joe
  • 4,521
  • 9
  • 53
  • 81
5
votes
4 answers

PHP function array_replace(), why are the arguments passed by reference?

The function signature on PHP.net for array_replace() says that the arrays will be passed in by reference. What would be the reason(s)/benefit(s) to doing it this way rather than by value since to get the intended result you must return the finished…
Jon Lyles
  • 345
  • 1
  • 3
  • 12
5
votes
3 answers

Overloading in php

Can any one tell what does below given lines means? The lines below are copied from PHP manual: Note: It is not possible to use overloaded properties in other language constructs than isset(). This means if empty() is called on an overloaded…
Poonam Bhatt
  • 10,154
  • 16
  • 53
  • 72
5
votes
2 answers

How to access the property/ value of an array which has been converted into an object?

How can I access the property/ value of an array which has been converted into an object? For instance, I want to access the value in the index 0, $obj = (object) array('qualitypoint', 'technologies', 'India'); var_dump($obj->0); error, Parse…
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
2 answers

Meaning of the $type parameter in socket_read()

I try to create a tcp/ip socket connection from a c# app to a PHP 5.3 script using PHP sockets. The c# app should send JSON strings to the PHP script. My question in regard to the socket_read manual: What do they mean with: "PHP_BINARY_READ…
Mike
  • 1,992
  • 4
  • 31
  • 42
4
votes
1 answer

PHP ignores passing by reference if var is assigned in function call

I have two functions function c( &$x ) { $x = 25; echo 'c is called, x = ' . $x . PHP_EOL; } function b() { echo 'b is called'. PHP_EOL; return 5; } Then I write the following code which as I expect should put result of b() to $o,…
Miroshko
  • 863
  • 6
  • 14
4
votes
2 answers

PHP Reflection: How to know if a ReflectionMethod is inherited?

In the ReflectionMethod documentation, I can't find anything to know wether a method was inherited from its parent class or defined in the reflected class. Edit: I use ReflectionClass::getMethods(). I want to know for each method if it has been…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261