Questions tagged [php-5.4]

PHP 5.4 is the successor to PHP 5.3. It was released on March 1, 2012. Use this tag for version-specific issues relating to specifically to PHP 5.4.

PHP 5.4 Changes:

  • Support for traits has been added.
  • Short array syntax has been added, e.g. $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];.
  • Function array dereferencing has been added, e.g. foo()[0].
  • Closures now support $this.
  • <?= is now always available, regardless of the short_open_tag php.ini option.
  • Class member access on instantiation has been added, e.g. (new Foo)->bar().
  • Class::{expr}() syntax is now supported.
  • Binary number format has been added, e.g. 0b001001101.
  • Improved parse error messages and improved incompatible arguments warnings.
  • The session extension can now track the upload progress of files.
  • Built-in development web server in CLI mode.

See Migrating from PHP 5.3.x to PHP 5.4.x for more information.

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

Running a python script within a bash file within a Yii project

I have a Yii project that allows importing files. Within this project I call the following command to try and convert xls files to csv: $file = fopen($model->importfile->tempname,'r'); $filetype = substr($model->importfile,…
James Sunderland
  • 135
  • 1
  • 1
  • 13
2
votes
0 answers

twitter application login always asks for permission

I'm using the artdarek package to implement the login process in my web application. I get a weird behavior by using the twitter login buton action; The application always asks for permission, although the user have accepted it already. Does twitter…
Dev DOS
  • 1,018
  • 4
  • 18
  • 45
2
votes
2 answers

PHP Warning: socket_read(): unable to read from socket [104]: Connection reset by peer

I use socket_create() to create socket Resource,then I bind an IP address to it by socket_bind(), its works fine; But after a while(more than 30 minutes) in line socket_read($sock, 2048) this error thrown : "PHP Warning: socket_read(): unable to…
Arash Mousavi
  • 2,110
  • 4
  • 25
  • 47
2
votes
1 answer

php 5.4 charset for Exception

In php 5.4 my code dont work properly. I use cyrillic charset. In short: throw new Exception('Сообщение'); will output: Fatal error: in test.php ... although the result would be: Fatal error: Uncaught exception 'Exception' with message ... If I…
tolec
  • 113
  • 1
  • 8
2
votes
1 answer

How can you query a specific nameserver (native php)

A tool I am creating enables users to modify their reversed DNS records. Since these records can also be modified through external methods, it is imperative that I can show the users their actual current reverse DNS records. As it stands both…
Damien Overeem
  • 4,487
  • 4
  • 36
  • 55
2
votes
1 answer

ini_set('post_max_size', '200M') did not work in php 5.4

ini_set('post_max_size', '200M') did not work in php 5.4 i had use following method. .htaccess , user.ini , php.ini , php5.ini but it did not effect of post_max_size. it remain on 64M. it change the memory limit and execution time but did not…
2
votes
1 answer

Deploying CakePHP to PHP 5.4.16 gives illegal string offset in CakePHP's Core

I have a PHP application which has been developed with CakePHP 2.4.6 on Ubuntu Virtual Machine with PHP 5.3.10-1ubuntu3.11 installed on it (with Apache2). My problem is that I wanted to deploy it to the real server, which has PHP 5.4.16 and I get…
zdtorok
  • 594
  • 1
  • 7
  • 21
2
votes
1 answer

/var/lib/php5 filled with empty session files

in my phpInfo i see that the session save path is /var/lib/php5 this directory gets filled with empty files with names like: "sess_fgf5gh2prbmnfs0ah3mcvpv4p4" i am not using any sessions on my server. is this php default behaviour?. this is a…
user2708100
  • 361
  • 1
  • 2
  • 11
2
votes
1 answer

How do i upload multiple images to remote server in this circumstances?Looping or repeat upload procedure?

I am new to php,trying to do a form, which allows me to upload a few text fields and then upload 3 images, the images are then uploaded into a remote server, and the name of the images are saved into database, so then it can be pulled out and…
Benyaman
  • 451
  • 2
  • 10
  • 25
2
votes
1 answer

How to change php executable used by CakePHP Console?

I have in my customer server 2 apaches/php version. So, the primary version (/usr/bin/php) is the old version, and other is the 5.4.17 (/usr/bin/php54). I verify the app/Console/cake file, and found the exec command. When I try change to php54 -q…
Patrick Maciel
  • 4,874
  • 8
  • 40
  • 80
2
votes
4 answers

strict standards errors on cakephp 1.3.4 PHP 5.4.12 and Apache 2.4.4 (wamp server)

I get strict standards errors when I trying to run a cakephp application (version 1.3.4) under PHP 5.4.12 and Apache 2.4.4. I cannot upgrade the cakephp version of the application right now. I tried all the proposed solutions online but nothing…
user765368
  • 19,590
  • 27
  • 96
  • 167
2
votes
1 answer

Is it safe to install another version of PHP?

I have WAMP with Apache v2.2.17 and PHP 5.3.5 installed. However, for one of my projects to work I need to use PHP 5.4. There doesn't seem to be a WAMP addon for PHP 5.4, so I'm thinking of downloading the standard installer from the PHP site and…
user1578653
  • 4,888
  • 16
  • 46
  • 74
2
votes
3 answers

php DateTime object does not give me errors for an invalid date input?

Why php DateTime object does not give me errors for an invalid date input? For instance, $date_test = '13-10-31'; $datetime = new DateTime(); $date = $datetime->createFromFormat('Y-m-d', $date_test); $date_errors =…
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
1 answer

Consume multiple queues by priority

I have a Producer sending messages to a topic exchange. Each message contains a routing key. (Apologies for the primitive diagram) P | X /| |\ / | | \ / | | \ Q1 Q2 Q3 Q4 | / / / | / / / | / / / …
agnitio
  • 137
  • 1
  • 10
2
votes
1 answer

Cannot use anonymous functions when using operator extension

I made a couple of testing with the closures in php5.4 and they all worked out until i enabled extension=operator.so. From what i could see was that when this extension is enabled i cannot declare functions like this: $myfunc = function($value) { …
helly0d
  • 828
  • 2
  • 10
  • 27