joomla / joomla-framework

[READ-ONLY] This repo is no longer in active development. Please see https://github.com/joomla-framework for the individual Framework packages.
http://framework.joomla.org
GNU General Public License v2.0
189 stars 140 forks source link

Joomla\String\String conflicts with PHP 7 #378

Closed jissereitsma closed 9 years ago

jissereitsma commented 9 years ago

I've just tested out the latest Joomla with PHP 7 and found that the \Joomla\String\String class is stopping Joomla from working under PHP 7. The reason is that "String" is a reserved word (or actually a reserved class) under PHP 7. So I hacked my Joomla a bit and renamed \Joomla\String\String (and all references to it) to \Joomla\String\Text - that worked out fine and is so far the only compatibility issue with PHP 7.

How do you think this is best solved? I've seen another project where they renamed String to String_ (yes, with an underscore) which sounds kind of stupid. So far the only good naming scheme I found was to rename it to Text (where the complete namespace would become \Joomla\Text\Text). What do you think?

RFC

mbabker commented 9 years ago

The String package has been updated to use StringHelper as the class name instead of String (see https://github.com/joomla-framework/string/pull/9). In CMS version 3.5 that change is backported and the String class isn't used by core (see https://github.com/joomla/joomla-cms/pull/6600).

jissereitsma commented 9 years ago

That's awesome. Sorry for not taking the extra peak at the latest progress ;)