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

sphinx on centos 7 cant started because of searchd.pid absent

I installed sphinx-2.2.11 on my CentOS 7 yum install -y postgresql-libs unixODBC wget http://sphinxsearch.com/files/sphinx-2.2.11-1.rhel7.x86_64.rpm yum install sphinx-2.2.11-1.rhel7.x86_64.rpm Installation went without any errors and then I…
Eugene S
  • 161
  • 1
  • 7
5
votes
1 answer

::class equivalent in PHP 5.4

I've got a PHP script with the following line: $class = Connection::class; This runs as expected on PHP 5.5 as explained here: http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class. However, it causes a syntax error in…
Ben Cook
  • 1,654
  • 2
  • 18
  • 32
5
votes
2 answers

White Screen of Death in Silex when switching from PHP 5.3 to Php 5.4 because of "session_start"

Finally I was able to repro the issue with the following two lines: session_set_save_handler(new SessionHandler()); session_start(); When I do this, I get a WSOD! Any idea why this…
Kiran Madipally
  • 817
  • 9
  • 15
5
votes
0 answers

Using Kendo UI PHP wrappers with Symfony2 Twig Template

I am using Kendo UI as the frontend library for a Symfony2.3.4 app and trying to establish best practices for working with Controllers and the Twig templating engine. My question is specific to the Kendo PHP wrapper library which allow for easy…
shotdsherrif
  • 433
  • 2
  • 10
  • 20
5
votes
4 answers

Global variable not working in php

I am facing some errors with use of global variables. I defined a $var in global scope and trying to use it in functions but it not accessible there. Please see below code for better explanation: File a.php:
spuri
  • 177
  • 1
  • 2
  • 9
4
votes
1 answer

PHP REQUEST_METHOD POST turns into GET

I'm trying to extend an old web application which uses CodeIgniter 1.7 (I know...) and am running into some trouble. I want a certain route to only be accessible via a POST request. So at the top of the function I have the following; if…
RobinJ
  • 5,022
  • 7
  • 32
  • 61
4
votes
2 answers

Replacing ::class in PHP 5.4

I'm using this Composer package for a development that requires the functionality this package provides. Looking for alternatives, I found out that this is my best bet, as the available alternatives are way too barebones to be implemented in the…
noquierouser
  • 963
  • 2
  • 11
  • 25
4
votes
1 answer

Class 'Memcached' not found-(php 5.4.9,windows 7)

I installed php-5.4.9(32 bit) on my windows 7 (64 bit machine) and configured it to run as a php-fpm process. I need memcached for my web application and hence installed memcached daemon and the necessary dll file in my php\ext folder. But when I…
Tojo Chacko
  • 1,230
  • 1
  • 13
  • 25
4
votes
1 answer

CodeIgniter - Creating default object from empty value

A PHP Error was encountered Severity: Warning Message: Creating default object from empty value Filename: models/Modeltest.php Line Number: 13 I am trying to create an array in model and returning it to the controller but it is giving this…
Nisar ahmed
  • 57
  • 1
  • 1
  • 8
4
votes
1 answer

PHP Built-in Webserver and Relative Paths

TL;DR Does PHP 5.4 built-in webserver have any bug or restriction about relative paths? Or does it need to be properly (and additionally) configured? When I used to programming actively I had a system working under URI routing using these lines in…
user753531
4
votes
1 answer

What makes Balloon evaluation unstable in Netbeans/Xdebug?

According to Netbeans docs and options pane, enabling the immediate evaluation ballons "destablizes" Xdebug: https://netbeans.org/kb/docs/php/debugging.html I haven't heard of specific instances where this happens, and I didn't see any Xdebug bug…
NoBugs
  • 9,310
  • 13
  • 80
  • 146
4
votes
1 answer

PHP 5.4 Built-in web server on home network

I'm running the PHP 5.4 built-in web server on my desktop PC. I can access my webpage on that same PC, but I was hoping I could access the page on my tablet as well. Is there any way I can open it up so I can access my page anywhere on my home…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
4
votes
1 answer

Warning: preg_replace(): Compilation failed: unknown option bit(s) set at offset -1

I recently upgraded my dedicated server to Apache 2.4.6, MySQL 5.5.32, and PHP 5.4.21. Now on my website I get this error: Warning: preg_replace(): Compilation failed: unknown option bit(s) set at offset -1 in…
Daniel Harris
  • 1,805
  • 10
  • 45
  • 63
4
votes
2 answers

PHP json_encode JSON_PRETTY_PRINT: how to print a different format?

I know that PHP provide the JSON_PRETTY_PRINT to format a json data already. What if I want a different format? $message = array( "Open all day" => "Sundays,Saturdays,12-12-2013, 14-10-2013", "Availabilty" => array( "12/12/2013" =>…
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
1 answer

>2GB file upload $_FILES["file"]["size"] negative number

I am getting at >2 GB file upload negative number at $_FILES["file"]["size"]. However file uploads fine and filesize() also returns correct size. But how to solve $_FILES to return correct value? I have read about the issues at some old versions of…
Wiggler Jtag
  • 669
  • 8
  • 23
1 2
3
26 27