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
0
votes
1 answer

Put values in a table from checkbox

I have a problem. I want to put dates into an array but when I make print_r() I get only the last value from checkbox. My code is: $id = Input::get('id'); $aObjects = Input::get('aObjects'); $iCount = count($aObjects); for($i=0; $i <…
Harea Costea
  • 275
  • 5
  • 19
0
votes
1 answer

php timezone returns empty array

i have a server and a local development machine. On my locale machine, if I want to create a new DateTimezone with UTC, it's ok, the response: php -r '$a = new \DateTimeZone("UTC"); var_dump($a);' class DateTimeZone#1 (2) { public $timezone_type…
ghostika
  • 1,473
  • 1
  • 12
  • 23
0
votes
2 answers

Count visitors by month

I have a question, so I want to build a chart compose of count visitors by date; I have in my database id created_at 1 2014-11-09 2 2014-11-10 3 2014-11-08 4 2014-10-01 5 2014-10-05 So I…
user3348229
  • 27
  • 1
  • 7
0
votes
1 answer

Insert unique ipaddress in database

I have a problem. I want to insert ipaddress and date of visit of each visitors in my database but the ip is inserted every time when I refresh the page or I open a news. My code: NewsController: public function __construct(){ …
user3348229
  • 27
  • 1
  • 7
0
votes
2 answers

laravel 302 error while login with employee id

Problem: I have user records each having unique emp id (integer 5), I am using my empid to log into the system but I am bumping into 302 error. now performing this while form data is posted with data : [ Note: using Laravel Framework version 4.2.9…
Daniel Euchar
  • 1,740
  • 5
  • 28
  • 45
0
votes
1 answer

Provider changes from PHP 5.3 to 5.4 - mail doesn't work anymore

since my provider changes to PHP 5.4 it seems, that my with php generated mails doesn't want to be sended anymore. are there any changes to php mail with 5.4? in 5.3 my code works fine: $mime->setHTMLBody($html); $mime->setTxtBody($text); $pro_hdrs…
Tom
  • 59
  • 1
  • 2
  • 16
0
votes
1 answer

Solr 4.7.1 with Tomcat 6 doesn't store romanian characters

When trying to store romanian special characters (diacritics) into a solr schema field, like: The romanian characters are: (ă,î,â,ș,ț) and they are…
Gabriel
  • 772
  • 1
  • 13
  • 37
0
votes
1 answer

Zend Application error if an unserialized object saved in $_SESSION since PHP 5.4

My Project is a mixed project (Non-Zend & Zend) If i set in a Non-Zend environment something like $myObject = new MyObject(); $_SESSION['foo'] = $myObject; and calling later a zend controller (http://mydomain.foo/zendControllerName) i get "An…
sg61
  • 1
  • 1
0
votes
3 answers

After Install Laravel 4 on Ubuntu 12.04 the requested URL / was not found on this server

I Installed Laravel 4 on Ubuntu 12.04, I follow these steps from - http://www.dev-metal.com/install-laravel-4-ubuntu-12-04-lts/ www.dev-metal.com/install-laravel-4-ubuntu-12-04-lts/ Activate mod_rewrite Install the mod_rewrite module (or…
Kamlesh Kumar
  • 1,632
  • 2
  • 21
  • 31
0
votes
1 answer

call_user_func with $this as a parameter in php 5.4

I need to call a dynamic function and send the current object as reference in the said function. In PHP 5.3 this works, as opposed to PHP 5.4: $value = call_user_func("MyFunction", $value, $row, $this,etc....); // using $this because this call…
Catalin
  • 773
  • 1
  • 7
  • 18
0
votes
1 answer

Why does my seed script for Laravel 4 generate improper insert queries?

I have started working with Laravel 4 and am stumped by a weird issue. I wrote my migrations for the table, which successfully creates the table.
jagzviruz
  • 1,453
  • 12
  • 27
0
votes
1 answer

Split an spliti are deprecated in Php 5.3. How can I replace them?

I'm implementing a function that converts float numbers to strings. function exp2int($exp) { list($mantissa, $exponent) = spliti("e", $exp); if($exponent=='') return $exp; list($int, $dec) = split("\.", $mantissa); bcscale…
Andres SK
  • 10,779
  • 25
  • 90
  • 152
0
votes
4 answers

Selecting a file from a directory randomly and then display it

I have a directory which contains several text files. What I'm trying to do is to randomly select one of the files and then display it. Here's what i got so far, but i still haven't managed to get it working. Any idea's? Thanks.
user2334436
  • 949
  • 5
  • 13
  • 34
0
votes
2 answers

Which engine? InnoDb or MyISAM?

I writing a online store script using php. Some scripts like opencart using MyISAM engine and someone using InnoDb. Now I don't know use which engine? InnoDb or MyISAM?
0
votes
1 answer

Site was designed in x cart. but some functions got deprecated

D/All, I am getting the below error in my web site. i think some functions has been deprecated due to higher version PHP 5.4.32. My site was designed in x cart. All the servers are upgraded to the latest C panel and php versions The site is working…
Karthick
  • 132
  • 6