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
1
vote
2 answers

Create an array from other 2

I have the following array: Array ( [aFlashParties] => Array ( [2015-07-07] => 20 [2015-07-08] => 48 [2015-07-09] => 42 [2015-07-10] => 94 [2015-07-11] => 0 [2015-07-12] => 0 [2015-07-13]…
TanGio
  • 766
  • 2
  • 12
  • 34
1
vote
1 answer

Table dynamic created with tha data

I have this script on php and i need to create table automatcally from that foreach ( $GetJobResult->Components->Component as $component_index => $component ) { $quote_title = ($component_index + 1) . ') ' . $component->Title . "-Machine…
test
  • 19
  • 5
1
vote
1 answer

FOSCommentBundle access control replying,deleting and editing Comments

I have successfully installed FOSComentBundle on my symfony2.3 project. I have integrated FOSCommentBundle with FOSUserBundle, then I added the role based ACL security.I have seen that the actions that can be controlled are…
Dev DOS
  • 1,018
  • 4
  • 18
  • 45
1
vote
1 answer

Login system in symfony 2

I tried to create an authentification system in symfony2 but no results. In the debug status bar for all situations I have : Logged as anon. If I make a dump of session in the view I get : "_security.last_error" => BadCredentialsException My…
TanGio
  • 766
  • 2
  • 12
  • 34
1
vote
1 answer

Html encode variable in quoted string

In PHP5.4, is it possible to html encode (using htmlspecialchars) a variable being used in a quoted string? For instance, is it possible to format the following so that $title is automatically encoded by PHP? echo "

$title

"; In ASP.NET (my…
freefaller
  • 19,368
  • 7
  • 57
  • 87
1
vote
1 answer

Track down PHP error "Comments starting with '#' are deprecated in Unknown on line 1 at Unknown#0"

I've just set up a RPi 2 with the latest stable Raspbian and installed some basic stuff (nginx, php5, ownCloud 8, SickBeard, sabnzbd+, ...). The ownCloud log shows a pretty generic error message at every page load and sometimes in between: Comments…
suamikim
  • 5,350
  • 9
  • 40
  • 75
1
vote
0 answers

Laravel Eloquent Query Buliding

I have four tables and I am giving my table structure here user_work['id', 'user_id', 'work_id'] work_sectors['id', 'name', 'status'] works['id', 'work_sector_id', 'work_type_id', 'work_duration_id', 'name'] users['id', ...] And My Models…
Dixit Sourav
  • 350
  • 1
  • 3
  • 10
1
vote
2 answers

Is there any compatibility issues with magento 1.5 and PHP 5.4

I have a Magento 1.5 site and PHP 5.3 version.I want to upgrade the PHP version to 5.4.Is there any compatibility issues will occur with magento 1.5? Is magento 1.5 support PHP version 5.4 ?
Amesh
  • 177
  • 2
  • 12
1
vote
0 answers

Sqlite3 query doesn't work under php-5.4.x anymore

I'm currently debugging an php-application that depends on a sqlite3 database and is stopped working after upgrading from php-5.3.x to php-5.4.33. This seems to work in both php-versions (so the sqlite3 connection seems to be OK): $db = new…
Arek van Schaijk
  • 1,432
  • 11
  • 34
1
vote
1 answer

SSE cannot maintain connection

I want to write a realtime server log viewer and just learned about SSE. I'm confused as to how to use it properly though. I'm running a Linux server with php 5.4. I have this code right now: HTML + JS: …
Cbas
  • 6,003
  • 11
  • 56
  • 87
1
vote
2 answers

Convert date into a unix timestamp

I have a problem with my conversion. I don't understand where is my problem, because normally all will be work, So my conversion doesn't work. $sEndDateFilter is 27/03/2015 23:59:59 When I tried to convert: $iEndDateFilter =…
Harea Costea
  • 275
  • 5
  • 19
1
vote
1 answer

App works in php 5.3 but not 5.4+

We're running a server app to activate our software, the web app and database itself works fine in php 5.4+ but the activation within the software causes an internal server error if we're running anything higher than php 5.3 (test with 5.4, 5.5 and…
realdannys
  • 1,383
  • 1
  • 12
  • 18
1
vote
2 answers

PHP Continue - removed support for variable numeric argument (e.g. continue $num)

http://php.net/manual/en/control-structures.continue.php Changelog says that as of 5.4, following change happened: Removed the ability to pass in variables (e.g., $num = 2; continue $num;) as the numerical argument. Why on earth would they do…
The Onin
  • 5,068
  • 2
  • 38
  • 55
1
vote
1 answer

PHP5.4 "parse_str" behaving unexpectedly

I am using Zend Framework 2's AbstractRestfulController to implement a CRUD API in our project. Using the PUT HTTP method invokes the logic for updating an existing entity. When receiving a PUT request, the AbstractRestfulController transforms the…
Subsurf
  • 1,256
  • 1
  • 17
  • 28
1
vote
1 answer

Is symfony 1.2 compatible with PHP 5.4?

Is symfony 1.2 compatible with PHP 5.4? We have an application which was built on symfony 1.2 and is currently running on a server with PHP 5.3.29 and MySQL 5.1.73. We now have a need to upgrade the server to PHP 5.4. Could someone please confirm…