Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration

I for some reason am getting an error when trying to deploy my app to a live server.

I am getting this error :

Parse error: syntax error, unexpected '[' in public_html/dev/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 411

function class_uses_recursive($class)
	{
		$results = [];

		foreach (array_merge([$class => $class], class_parents($class)) as $class)
		{
			$results += trait_uses_recursive($class);
		}

		return array_unique($results);
	}

I am aware that Laravel 4 needs PHP >= 5.4 and I am currently running 5.4 on my host, as well as my dev environment (which the app runs fine) and in the code above I am aware that '[ ]' is shorthand for the older array();

This is probably something I am just overlooking but my brain seems to be not working well this morning.

Thanks in advance!

Last updated 2 years ago.
0

Same thing here PHP version 5.4.20 running on dreamhost.

I updated laravel to create a new project and when I tried to access the /public folder it crashes with the same error =S.

Does changing the [] to array() fix the issue?

Thanks ;)

Last updated 2 years ago.
0

SOLVED!

I don't know what happened with my dreamhost server but when login via ssh and checking version on the terminal it said 5.4, however I accessed the Control Panel and the PHP version was set to 5.3.

Hope this helps sbdy.

Cheers ;)

Last updated 2 years ago.
0

Same here please anyone help us

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

JCFutch jcfutch Joined 30 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.