Skip to content

Commit ff6fa22

Browse files
committed
Restore PHP 5.3 and 5.4 compatibility
1 parent de71450 commit ff6fa22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sabberworm/CSS/Value/Size.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public static function parse(ParserState $oParserState, $bIsColorComponent = fal
3737
}
3838

3939
$sUnit = null;
40-
foreach (self::getSizeUnits() as $iLength => &$aValues) {
40+
$aSizeUnits = self::getSizeUnits();
41+
foreach($aSizeUnits as $iLength => &$aValues) {
4142
$sKey = strtolower($oParserState->peek($iLength));
4243
if(array_key_exists($sKey, $aValues)) {
4344
if (($sUnit = $aValues[$sKey]) !== null) {
@@ -51,7 +52,7 @@ public static function parse(ParserState $oParserState, $bIsColorComponent = fal
5152

5253
private static function getSizeUnits() {
5354
if(self::$SIZE_UNITS === null) {
54-
self::$SIZE_UNITS = [];
55+
self::$SIZE_UNITS = array();
5556
foreach (explode('/', Size::ABSOLUTE_SIZE_UNITS.'/'.Size::RELATIVE_SIZE_UNITS.'/'.Size::NON_SIZE_UNITS) as $val) {
5657
$iSize = strlen($val);
5758
if(!isset(self::$SIZE_UNITS[$iSize])) {

0 commit comments

Comments
 (0)